I have been struggling to find a solution when planning this data model:
Suppose we have 3 separate collections, 1) Product 2) Address the product is going to and 3) the Recipient that is to receive the product.
The reasons I would like to keep these as 3 separate referenced collections are the following:
- a. Besides the address itself, the address collection contains other data pertinent to that address.
b. There might be several Recipients residing at the same address.
- The recipient too I would like to have individually searchable, modifyable and rich with additional data needed elsewhere.
- I would like to ensure the products have good addresses and correct recipients by creating references inside to the Address and Recipient collections, however I am not sure that is wise.
To sum up:
- A product needs to know where (Address) it goes and to whom (Recipient).
- An Address needs to keep track of possibly several Recipients living at it.
- A Recipient should potentially contain intel about its living place (Address).
Could you kindly suggest some ideas how should one go about designing a solution around this problem? I have spent this whole day reading about embedded documents, referenced documents but I seem to constantly miss the Eureka! moment and not fully work out what would be the most efficient way.
Thanks a lot