Last active
July 11, 2021 11:36
-
-
Save mertyertugrul/a983d7d642d4f3835a7c921f6a5f1b0f to your computer and use it in GitHub Desktop.
MongoDB Convert Field Type to Date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.Purchases.updateMany( | |
{}, | |
[{"$set":{"<fieldName>":{"$toDate":"$<fieldName>"}}}] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment