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

< / Div>

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

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -