-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
It should be possible to change _ids on embedded documents. The following code does not work:
class Kangaroo include Mongoid::Document embeds_one :baby end class Baby include Mongoid::Document embedded_in :kangaroo field :name, type: String end kangaroo = Kangaroo.new baby = Baby.new(name: 'test1') kangaroo.baby = baby kangaroo.save! kangaroo.update(baby: { _id: BSON::ObjectId.new, name: 'test2'})
When updating an embedded document with a new _id, the entire update is ignored (quietly, but MONGOID-5225 is trying to fix that).
This ticket proposes that we allow for the _id to be updated in embedded documents
- is related to
-
MONGOID-5225 Updating embedded docs with a different _id is not working in 7.3
- Closed