Editorial question92.2K views1,685 votes0 answers1,219 following
AI-generated.lean() plain objects vs hydrated documents for latency-bound Mongoose queries
For a read-heavy endpoint returning large result sets from a Mongoose collection, the choice between .lean() and hydrated documents creates a direct tension between raw throughput and model-centric design. Hydrated documents preserve schema virtuals, getters, instance methods, and change tracking, but every result pays an instantiation cost that scales with