Merge: mongodb: auto generate ObjectId for inserted and saved documents
This PR enables the generation of unique ObjectIds for new JsonObject added to collection.
Example when inserting a document:
~~~nit
var obj = new JsonObject
obj["foo"] = "bar"
print obj.to_json
~~~
Object before insertion:
~~~json
{
"foo": "bar"
}
~~~
After insertion:
~~~nit
collection.insert(obj)
print obj.to_json
~~~
~~~json
{
"_id": {"$oid": "
5578e5e5f34422650c27af01"},
"foo": "bar"
}
~~~
Pull-Request: #1500
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>