[DOCS-1561] Does mongod create an ObjectId for a missing _id field or not? Created: 03/Jun/13 Updated: 03/Nov/17 Resolved: 03/Jul/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ed Costello | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | newwriter | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Location: http://docs.mongodb.org/manual/reference/object-id/ |
||
| Participants: | |
| Days since reply: | 10 years, 33 weeks ago |
| Description |
|
First there's: "the mongod adds the _id field and generates a unique ObjectId to assign as its value." but later in the *Important* note there is this: "Clock skew between clients can also result in non-strict ordering even for values, because client drivers generate ObjectId values, not the mongod process." Which is it? Is it the case that the client driver could create an _id field with a local ObjectId, but if it didn't then the mongod creates it? |
| Comments |
| Comment by auto [ 03/Jul/13 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by auto [ 03/Jul/13 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by Sam Kleinman (Inactive) [ 04/Jun/13 ] |
|
Agreed. Will revise... |
| Comment by Ed Costello [ 04/Jun/13 ] |
|
I agree that it's technically accurate but think it could be clearer. |
| Comment by Scott Hernandez (Inactive) [ 03/Jun/13 ] |
|
Yes, the server creates it if the client doesn't. But in almost all cases the client should be creating it. The docs read good to me. |