-
Type: Spec Change
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Component/s: CRUD
-
None
-
Needed
Currently behavior in drivers is as follows:
- If there is no _id present on an insert, drivers will generate an _id as a bson ObjectId.
What is currently not specified and/or universal:
- Should drivers generate a client-side objectID for upserts using either update or findAndModify (AFAIK no driver does this)
- Should drivers support the ability to disable client-side _id generation (currently Node supports this via the forceServerObjectId option. I do not know of another driver that does)
- Should drivers support the ability to change the type of the _id generated at the collection/db/client level? (Node currently supports passing a pkFactory that will be used to generate all client-side {{_id}}s)
We should be able to answer the above questions, and codify behavior across drivers for client-side _id generation.