MongoDB Compass - 如何插入日期类型?
MongoDB Compass - How To Insert Date Type?
使用 MongoDB Compass 将文档插入 MongoDB 数据库时,如何插入当前日期?
我试过这样:
但是如您所见,出现了错误。
如何使用 MongoDB 指南针插入当前日期?
这样试试:
2016-01-24T13:21:55.000
这样试试:
{
"type":"grunt",
"last_used": {
"$date": "2018-04-15T16:54:40.000Z"
},
"created_at": {
"$date": "2018-04-15T16:54:40.000Z"
}
}
这样试试
{
"type": "grunt",
"last_used": {"$date":{"$numberLong":"1602720972129"}},
"created_at":{"$date":{"$numberLong":"1602720972129"}}
}
使用 MongoDB Compass 将文档插入 MongoDB 数据库时,如何插入当前日期?
我试过这样:
但是如您所见,出现了错误。
如何使用 MongoDB 指南针插入当前日期?
这样试试:
2016-01-24T13:21:55.000
这样试试:
{
"type":"grunt",
"last_used": {
"$date": "2018-04-15T16:54:40.000Z"
},
"created_at": {
"$date": "2018-04-15T16:54:40.000Z"
}
}
这样试试
{
"type": "grunt",
"last_used": {"$date":{"$numberLong":"1602720972129"}},
"created_at":{"$date":{"$numberLong":"1602720972129"}}
}