Im looking to have a document, which contains a collection of references to other documents. Like a Project
that has a collection of Users
, but the entries are Reference
types to users from the top level Users
collection.
I can't see a way of adding a Reference
type to a Collection, It looks like you must create a Document
first and then have a field in that doc that is the reference to the user doc - but that is just adding extra work.
When getting the collection data, you will have to first get the Document in the collection, and then using the field for the reference get the User Document.
It would be far simpler to have a nested array of values.
What is the best way to store a collection of references ?