Error parsing date string: passing a time zone identifier as part of the string is not allowed

hello team,

I am leveraging toDate in aggregation function and seems like i am running into issues during conversion

here is a sample data field 2021-09-16T18:31:12.553723274Z and i have this as finish_time which gets populated by system and start_time as `2021-09-10T21:19:13Zand based on my understanding i believe this format"%Y-%m-%dT%H:%M:%S.%LZ"` only works if %L is only 3 digits or less and based on my time format its more than 3 digits and its failing due to that. Is there a way to convert this considering this is standard format and leverage any inbuilt functions for this?

btw i have mongodb 4.2.6 and wondering if there is a way to define custom format or increase the digit count for %L in the default format to fit these conversions?


Uncaught exception: Error: command failed: {
   "errmsg":"Error parsing date string '2021-10-01T08:17:48.849825775Z'; 0: passing a time zone identifier as part of the string is not allowed '2'",
} : aggregate failed :


You may be hitting a BUG related to timelib
Check this open issue