[DOCS-1298] Comment on: "manual/core/object-id.txt" Created: 25/Mar/13 Updated: 01/Apr/13 Resolved: 29/Mar/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Blocker - P1 |
| Reporter: | Tilo S | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | collector-298ba4e7 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDB 2.2 Location: http://docs.mongodb.org/manual/core/object-id/ |
||
| Participants: | |
| Days since reply: | 10 years, 46 weeks, 2 days ago |
| Description |
|
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 Reporter: Tilo S |
| Comments |
| Comment by auto [ 01/Apr/13 ] |
|
Author: {u'date': u'2013-04-01T15:14:47Z', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by auto [ 01/Apr/13 ] |
|
Author: {u'date': u'2013-04-01T15:14:47Z', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: Conflicts: |
| Comment by Tilo S [ 29/Mar/13 ] |
|
Hi Sam, I see the jira ticket is now closed, but that sentence is still in the documentation: Sorting on an _id field that stores ObjectId values is equivalent to sorting by creation time. this is factually incorrect, and needs to be clarified regards |
| Comment by auto [ 29/Mar/13 ] |
|
Author: {u'date': u'2013-03-28T14:18:20Z', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by Tilo S [ 28/Mar/13 ] |
|
I just realized that what I'm seeing might be due to the fact that the finest granularity of MongoDB's _id's might be just 1 second – can you verify this? – if that's the case, there should be at least a big disclaimer in the documentation. This was mentioned in this talk: http://www.10gen.com/presentations/mongosv-2011/mongodb-as-a-message-queue If that's true, this means that if you add lots of records within the same second, it can happen that when you look at the records in insertion order, that the _id is not continuously growing - e.g. _id is not always sorted by real creation time If this is true, one should use an inserted_at timestamp for sorting, rather than the _id |
| Comment by Kay Kim (Inactive) [ 27/Mar/13 ] |
|
Hi Tilo – Updated. Regards. Kay |
| Comment by Tilo S [ 27/Mar/13 ] |
|
Kay, can you please modify JIRA for this Bug, so it correctly associates this bug with my account, instead of showing my full name and email address? thank you! Email addresses should never be visible when not logged in |
| Comment by Tilo S [ 27/Mar/13 ] |
|
this happened on a non-sharded replicaset |