Answers for "search with where clause mongoose"

0

mongoose find multiple conditions

User.find({$or:[{region: "NA"},{sector:"Some Sector"}]}, function(err, user) 
 {
    if (err)
    {
        res.send(err);
    }
    console.log(user);
    res.json(user);

 });
Posted by: Guest on July-30-2020
0

mongoose search by name

let ids = ['id1','id2','id3']
let data = await MyModel.find(
  {'_id': { $in: ids}}
);
Posted by: Guest on January-03-2021

Code answers related to "search with where clause mongoose"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language