How to do a mongo search with condition parameters, type:
Collection.find({userId}, {done: true}).fetch();
In this way, I want to return all the documents that have the done equal to true, searching the User id.
I have in the collection a userID , _id collection, and the done
I'm using Meteor and grahql, this is my solve
Query: {
async taskCompleted(obj, args, {userId}) {
return await Tasks.find({userId}).fetch();
}
}
In this code snippet, it returns all the tasks of the user in question