Answers for "mongoos find by id"

Go
11

mongo console find by id

db.collection.find({_id:ObjectId('5e208c18d598b806c869ca37')}).pretty()
Posted by: Guest on April-27-2020
2

find one with specofoc id mongoose

YOUR_MODEL_NAME.findOne({_id: reqParameterID}, function(err, result) {
    if (err) {
      console.log(err);
    } else {
      // Do Something 
    }
  });
Posted by: Guest on June-05-2020

Browse Popular Code Answers by Language