[Solved] What is the best way to query data conditionally in MongoDB (node.js)?
To come up with a functioning MongoDB query that determines whether a user is part of a group requires an understanding of how you’re structuring your database and groups collection. One way to structure that is like so: { “_id” : ObjectId(“594ea5bc4be3b65eeb8705d8”), “group_name”: “…”, “group_members”: [ { “user_id”: ObjectId(“<same one from users collection”), “user_name”: “Alice”, … Read more