[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/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36
Screen Resolution: 1440 x 900
repo: docs
source: 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: DOCS-1561: adding clarification about automatic generation of object ids.
Branch: master
https://github.com/mongodb/docs/commit/22d0393c163d281524ddc2d97b4f4fea451a721b

Comment by auto [ 03/Jul/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1561: adding clarification about automatic generation of object ids.
Branch: v2.2
https://github.com/mongodb/docs/commit/7be1c01abaefd50f54d300f18a1ef8a1380e49c2

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.

Generated at Thu Feb 08 07:41:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.