Skip to content

Instantly share code, notes, and snippets.

@paragasu
Created March 12, 2021 10:46
Show Gist options
  • Save paragasu/534f8b5aa9e7dd4b89db0df725555301 to your computer and use it in GitHub Desktop.
Save paragasu/534f8b5aa9e7dd4b89db0df725555301 to your computer and use it in GitHub Desktop.
db.ReturnRecord.find().forEach(doc => {
if (typeof doc.created_datetime == 'string') {
console.log(typeof doc.created_datetime, doc.created_datetime);
doc.created_datetime = new Date(doc.created_datetime);
db.ReturnRecord.save(doc)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment