2
I wonder if it is good practice to create a relationship between two collections (Collections) in Mongodb.
Suppose I have a collection for users, with a scheme like this:
{
"_id": ObjectId(...),
"username": "",
"groups": [
ObjectId(...),
ObjectId(...)
]
}
But the ID’s placed in the array groups
would be referring to the ID’s of the collection groups "groups".
This is good practice or should I use SQL for this?
If it’s good practice, how can I create this kind of thing in Mongodb?