ruby on rails - Best practices for mongoid relations -


i mapping relations in mongoid, want know best practices mongoid.

models

  1. customer
  2. service
  3. supplier

there 4 different services (s1, s2, s3, s4), each service provided specific supplier. how can map these models or build relations among them?

thanks in advance.

you can either of these approaches, both supported mongoid:

as schema decisions in mongodb, approach choose should largely based on use cases, , kinds of queries anticipate needing in application. question provides overview when embed vs. reference in mongodb:

mongodb relationships: embed or reference?

see relations page of mongoid docs more details relationships in mongoid.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -