-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
As being discussed on this thread, http://groups.google.com/group/mongodb-user/browse_thread/thread/b96f121ec5eaba72,
it would be nice to have an option in a driver to create _id as a string type. The current default one, to assign _id as ObjectId, break interoperability of the inserted document, since it doesn't requested by the insertion time and user application can expect inserted docs to be JSON complaint. Having such default, via ObjectId, break such expectation and create a problem to exchange documents via JSON format, since ObjectId is not serializable. So we have either to customize JSON serialization or allow somehow to specify that _id should be a string type. In later case it can be done either in client code or inside of the driver. Since client code doesn't create such _id, even it could, it is natural to expect that driver should take care of that. So, I propose to add additional option to insert/update, e.g. json_strict=True/False, to resolve this issue.