Embedded Associations

suggest change

Mongoid allows Embedded Associations:

To embed many addresses on a user, add this to User:

embeds_many :addresses

and this to Address:

embedded_in :user

Address documents are then stored inside the user document, and User gains an addresses method. There is no separate addresses collection.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents