mongoose-lean-id
Attach id
to the results of mongoose queries when using .lean()
(This fork prevents crash when _id is missing. Also using for loop for optimization.)
Usage
const mongooseLeanId = ;
examples
.id
to result of find, findOne, and findOneAndUpdate if lean
It attaches const schema = name: String ; schema; const Model = mongoose; return Model ;