What is the difference between Model.findOne() & Model.findById() in Mongoose?

findById is just a convenience function that does exactly the same thing as the findOne call you show.

Here’s the source:

Model.findById = function findById (id, fields, options, callback) {
  return this.findOne({ _id: id }, fields, options, callback);
};

Leave a Comment