-
Type: Task
-
Resolution: Done
-
Priority: Blocker - P1
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Environment:MongoDB 2.2
*Location*: http://docs.mongodb.org/manual/core/object-id/
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17
*Referrer*: http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDYQFjAA&url=http%3A%2F%2Fdocs.mongodb.org%2Fmanual%2Fcore%2Fobject-id&ei=lpBQUfPPK8mziwKhuICICw&usg=AFQjCNH2qKto2l0j7fwuzWX2-f9J-i54qg&sig2=WCgs5Jli4zcxuA0WD8xBMg&bvm=bv.44158598,d.cGE
*Screen Resolution*: 1680 x 1050
*repo*: docs
*source*: core/object-id
MongoDB 2.2 *Location*: http://docs.mongodb.org/manual/core/object-id/ *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17 *Referrer*: http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDYQFjAA&url=http%3A%2F%2Fdocs.mongodb.org%2Fmanual%2Fcore%2Fobject-id&ei=lpBQUfPPK8mziwKhuICICw&usg=AFQjCNH2qKto2l0j7fwuzWX2-f9J-i54qg&sig2=WCgs5Jli4zcxuA0WD8xBMg&bvm=bv.44158598,d.cGE *Screen Resolution*: 1680 x 1050 *repo*: docs *source*: core/object-id
the documentation says:
Sorting on an _id field that stores ObjectId values is equivalent to sorting by creation time.
that does not seem to be the case, e.g. I have the following keys (in insertion order), when sorted by _id, they do not reflect insertion time:
_id insertion_time.to_i
"50999c8c91e3783e0e000001", 1352244364
"50999c8c91e3783e0e000002", 1352244364
"50999c8c91e3783df4000001", 1352244364 <-- _id not larger than pervious _id
"50999c8c91e3783e08000001", 1352244364
"50999c8c91e3783e08000002", 1352244364
"50999c8c91e3783e50000001", 1352244364
"50999c8d91e3783e0e000003", 1352244365
"50999c8d91e3783e0e000004", 1352244365
"50999c8d91e3783e21000001", 1352244365
"50999c8d91e3783e21000002", 1352244365
Reporter: Tilo S