I have a collection as follows,
i want to query and populate only reviews which has the userId '233232' inside fromUser.
Right now my helper class is as follows,
queryaggregateWithProject: function (model, matchedCond, prjCond) {
return new Promise(function (resolve, reject) {
model.aggregate([
{$match: matchedCond},
{$project: prjCond}
], function (error, data) {
if (error)
reject(error);
resolve(data);
});
})
}
what should i pass for matchedCond and projCond?
via face turn
No comments:
Post a Comment