What is the difference between find().lean() and a normal Mongoose document?

MongoDB and Mongoose · Freshers and experienced

Model answer

lean() returns plain JavaScript objects instead of full Mongoose documents, so it is faster and uses less memory. You lose getters, virtuals and save(). Use it for read-only responses such as list endpoints.

Learn this topic

Connect Express to MongoDB with Mongoose in the course MERN Stack Full Course: MongoDB, Express, React and Node.js.

Sign in to add your own answer.

More questions