ruby on rails - update embedded documents mongodb with mongoid -
I'm having trouble updating documents embedded in mp3db.
I have the following scenario. A user model is known as edged docs.
I am able to embed the address to the parent model; User model but I still do not know how to update Embedded address embedded though I have _id of address
Please help
thanks
You will need to retrieve the embedded document from the parent and then perform an operation operation, such as:
< Code> address = user.address address.update_attributes (: road = & gt; "foo")
Comments
Post a Comment