Reputation: 681
Can anyone explain to me the difference between embeds_many
and has_many
in mongoid?
Upvotes: 42
Views: 10290
Reputation: 9167
embeds_many
is used to store relative documents inside of parent document.
has_many
is used to store a relation between documents in separate collections. Relative records of has_many
have field that stores id of the parent document.
Upvotes: 66