Paul Done 5/3/2020

Converting Gnarly Date Strings to Proper Date Types Using a MongoDB Aggregation Pipeline

Read Original

This article details a solution for converting incomplete date strings (e.g., '23-NOV-20 22.57.36.827000000') into proper MongoDB Date types. It explains the challenges with missing century and timezone data, and provides a step-by-step tutorial using the $dateFromString operator and string manipulation within an aggregation pipeline to enable native date operations.

Converting Gnarly Date Strings to Proper Date Types Using a MongoDB Aggregation Pipeline

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser