Access DB Ref MongoDB -
What is the best way to access / query a DB referee: Update:
User: Name, groupref: {$ ref: "groups", $ id: "ObjectId ..."}} group: name, topic, country, ..., ..
The impression is that the user belongs to only one group, how do I get all the users for a group whose country starts with the letter 'A'? Country is a string.
In addition to this, how will it change if users bellengadda for more than 1 group?
db.users.find ({group ref: {$ ref: "group", $ id: group._id}})
Comments
Post a Comment