Answer the question
In order to leave comments, you need to log in
How to fetch from MongoDB?
Hello! The question arose, rather from an insufficient understanding of how to make a selection from the database.
For example, we have the following collections:
Users: {_id, name, password, email}
Teams: {_id, name, team_leader, team_members: []}
Clients: {_id, name, team_id, profile: [], users_access: []}
Tasks: {_id, task, team_id, user_creator_id, access_users: []}
I don't understand at all how to select clients and tasks for a team member if he has access (users_acces).
In my understanding:
Answer the question
In order to leave comments, you need to log in
Sampling works fine in mongo
Clients.find({ users_access: this.userId})
Tasks.find({access_users: this.userId}
) Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question