When inserting a document into a MongoDB database with MongoDB Compass how do I insert the current date?
I have tried like so:
But as you can see there is an error.
How do I insert the current date using MongoDB Compass?
When inserting a document into a MongoDB database with MongoDB Compass how do I insert the current date?
I have tried like so:
But as you can see there is an error.
How do I insert the current date using MongoDB Compass?
Try like this:
{
"type":"grunt",
"last_used": {
"$date": "2018-04-15T16:54:40.000Z"
},
"created_at": {
"$date": "2018-04-15T16:54:40.000Z"
}
}
Try like this
{
"type": "grunt",
"last_used": {"$date":{"$numberLong":"1602720972129"}},
"created_at":{"$date":{"$numberLong":"1602720972129"}}
}
© 2022 - 2024 — McMap. All rights reserved.