Answers for "mongoose find array includes"

0

mongoose query using an arry

var query = PUser.find({'userID': {$in:array}});
Posted by: Guest on May-15-2020
0

mongoose find in array

Or, if teamIds is a string of comma-separated id values, you need to convert it into an array of values using split:
Team.find({
    '_id': { $in: teamIds.split(',') }
}, function(err, teamData) {
    console.log("teams name  " + teamData);
});
Posted by: Guest on November-03-2021
1

mongoose array includes

// As favouriteFoods is a simple array of strings, 
// you can just query that field directly:

// favouriteFoods contains "sushi"
PersonModel.find({ favouriteFoods: "sushi" }, ...);
Posted by: Guest on May-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language