google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

Rails mongo adapter (mongid, mongomapper) set an objectid into @embedded #217

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Morphia 0.98

@Embedded doc in morphia has no ObjectId. It causes some integration problem
when mongodb is used also by rails program.

Is it possible to handle an objectid generation in embedded doc in the futur ?

Original issue reported on code.google.com by jeremy.g...@gmail.com on 25 Jan 2011 at 2:12

GoogleCodeExporter commented 9 years ago
This is by design. You can reproduce this behavior by using a field of type 
ObjectId with a value.

Original comment by scotthernandez on 25 Jan 2011 at 10:19

GoogleCodeExporter commented 9 years ago
Thanks, i make it work with an objectId field in morphia 0.99 snapshot but it 
don't work in morphia 0.98, field is inserted in mongo like this :

"_id" : { 
"_time" : -1781383603, 
"_machine" : 1089600229, 
"_inc" : 52109999 
}, 

instead  of :

"_id" : ObjectId("4d3ed2956988536fd498cc51"). 

Original comment by jeremy.g...@gmail.com on 25 Jan 2011 at 11:29