Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
2.4.4, 2.5.0
-
None
-
ALL
Description
Depending on whether the shell saves ts as
{t: xxx, i: x}or Timestamp(xxx,x) different queries return different results even though they appear the same in the shell.
test@(2.5.0) > db.querytest.insert({ts:Timestamp(1371589951, 5)})
|
Inserted 1 record(s) in 310ms
|
test@(2.5.0) > db.querytest.insert({ts:{ "t" : 1371589951, "i" : 5 }})
|
Inserted 1 record(s) in 1ms
|
test@(2.5.0) > db.querytest.find({ts: { "$gte" : Timestamp(1371589951, 1), "$lte" : Timestamp(1371589952 , 1) } } )
|
{ "_id" : ObjectId("51d1bbbffce6ce6f1f87fb4e"), "ts" : Timestamp(1371589951, 5) }
|
Fetched 1 record(s) in 3ms
|
test@(2.5.0) > db.querytest.find({ts: { "$gte" : {t: 1371589951, i: 1}, "$lte" : {t: 1371589952 , i: 1} } } )
|
{ "_id" : ObjectId("51d1bbc6fce6ce6f1f87fb4f"), "ts" : { "t" : 1371589951, "i" : 5 } }
|
test@(2.5.0) > db.querytest.find()
|
{ "_id" : ObjectId("51d1bbbffce6ce6f1f87fb4e"), "ts" : Timestamp(1371589951, 5) }
|
{ "_id" : ObjectId("51d1bbc6fce6ce6f1f87fb4f"), "ts" : { "t" : 1371589951, "i" : 5 } }
|
Fetched 2 record(s) in 0ms
|
Behaves the same in 2.5.0 and 2.4.4