mongoosejs / mongoose-lean-virtuals

Attach virtuals to the results of mongoose lean() queries
Apache License 2.0
45 stars 24 forks source link

Typescript: types conflict @types/mongoose #3

Closed maxsh8x closed 7 years ago

maxsh8x commented 7 years ago

screenshot from 2017-08-25 11-17-14

vkarpov15 commented 7 years ago

Sounds like an issue with your typescript bindings. Our docs do say that lean() now accepts either a boolean or an object. Please open up an issue here: https://github.com/DefinitelyTyped/DefinitelyTyped

flyinghawker commented 5 years ago

seems like the issue still exists in mongoose v5.4.19

/**

  • Sets the lean option.
  • Documents returned from queries with the lean option enabled are plain
  • javascript objects, not MongooseDocuments. They have no save method,
  • getters/setters or other Mongoose magic applied.
  • @param bool defaults to true */ lean(bool?: boolean): Query & QueryHelpers;

lean doesn't support object.

vkarpov15 commented 5 years ago

@flyinghawker false: https://github.com/Automattic/mongoose/blob/5e47d8be8b35599e4997d5f2ef88ef19c7853a32/lib/query.js#L1597 . Either way, this isn't a typescript bindings repo, please open an issue there