Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 355 Bytes

section24.5.md

File metadata and controls

16 lines (13 loc) · 355 Bytes

Section 24.5: Useful Mongoose functions

Mongoose contains some built in functions that build on the standard find().

doc.find({'some.value':5},function(err,docs){
  //returns array docs
});

doc.findOne({'some.value':5},function(err,doc){
  //returns document doc
});

doc.findById(obj._id,function(err,doc){
  //returns document doc
});