Mongoose list endpoint is slow: how to tell hydration overhead from a bad query plan before adopting lean()
On a read-heavy Mongoose list endpoint (assume Mongoose 7/8, Node 18+, MongoDB 6), the plan is to measure before optimizing. The candidate lever is the documented query.lean() option, which returns plain JavaScript objects instead of hydrated documents, skipping change tracking, getters, and middleware state. But that only helps if request time is dominated