mongoosejs / mongoose-lean-getters

Apply getters on lean() documents: https://mongoosejs.com/docs/tutorials/lean.html
Apache License 2.0
10 stars 15 forks source link

Error (reading 'selectedInclusively') in 0.3.1 #13

Closed Marius-Romanus closed 2 years ago

Marius-Romanus commented 2 years ago

Hello, with version 0.3.0 it works fine, but with undefined ones (https://github.com/mongoosejs/mongoose-lean-getters/issues/9), but when updating to 0.3.1 I get the following error:

TypeError: Cannot read properties of undefined (reading 'selectedInclusively')
    at project folder\node_modules\mongoose-lean-getters\index.js:79:14
    at Schema.eachPath (project folder\node_modules\mongoose\lib\schema.js:1270:5)
    at applyGettersToDoc (project folder\node_modules\mongoose-lean-getters\index.js:78:10)
    at model.Query.applyGettersToDoc (project folder\node_modules\mongoose-lean-getters\index.js:74:7)
    at model.Query.applyGetters (project folder\node_modules\mongoose-lean-getters\index.js:46:27)
    at model.Query.applyGetters (project folder\node_modules\mongoose-lean-getters\index.js:59:20)
    at model.Query.<anonymous> (project folder\node_modules\mongoose-lean-getters\index.js:34:18)
    at project folder\node_modules\mongoose-lean-getters\index.js:17:12
    at project folder\node_modules\mongoose\lib\query.js:4791:15
    at project folder\node_modules\mongoose\lib\model.js:4996:18

mongoose 6.3.0 mongoose-lean-getters 0.3.1 MongoDB 5.0.6 Node 16.14.0

Regards