Answers for "mongoose search by name"


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

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 "mongoose search by name"

Code answers related to "Javascript"

Browse Popular Code Answers by Language