Answers for "finding in mongoose using a name"

0

finding in mongoose using a name

var name = 'Peter';
model.findOne({name: new RegExp('^'+name+'$', "i")}, function(err, doc) {
  //Do your action here..
});
Posted by: Guest on May-24-2021
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 "finding in mongoose using a name"

Browse Popular Code Answers by Language