通过指定 ts.t 找不到条目(ts 是时间戳类型)
挖oplog,想知道一秒有多少操作。
通过指定时间戳字段无法找到条目,其他字段也可以。$ 在 mongo shell 中:
> db.oplog.rs.findOne()
{
"ts" : {
"t" : 1335200998000,
"i" : 540
},
"h" : NumberLong("4405509386688070776"),
"op" : "i",
"ns" : "new_insert",
"o" : {
"_id" : ObjectId("4f958fad55ba26db6a000a8b"),
"username" : "go9090",
"message" : "hello, test.",
}
}
> db.oplog.rs.find().count()
419583
> db.oplog.rs.test.find({"ts.t":1335200998000}).count()
0
> db.oplog.rs.test.find({"ts.t":/^1335200998/}).count()
0
> db.oplog.rs.test.find({ts:{ "t" : 1335200998000, "i" : 540 }}).count()
0