我有一个名为“ mycustomers”的数据库,该数据库具有一个名为“ customers”的集合
数据库当前具有这些文档
我已经执行了该查询
db.customers.update({}, {$currentDate: {TimeStamp: {$type: "date"}}});
为什么此语句不能更新集合中的所有文档?
结果在下面
{
"_id" : ObjectId("5b3504203abb335c552137b7"),
"gender" : "male",
"Timestamp" : ISODate("2018-06-30T11:36:14.516Z")
}
{
"_id" : ObjectId("5b3505533abb335c552137b8"),
"first_name" : "John",
"gender" : "male"
}
{
"_id" : ObjectId("5b3505533abb335c552137b9"),
"first_name" : "Steven",
"gender" : "male"
}
{
"_id" : ObjectId("5b3505533abb335c552137ba"),
"first_name" : "Lady",
"gender" : "female"
}
{ "_id" : ObjectId("5b3732f990418e4b51b563d4") }
{ "_id" : ObjectId("5b3733d790418e4b51b563da") }