mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Fix wrong type definition on lean function parameter (#35916)
* Fix wrong type definition on lean function parameter * Update the parameter type in lean function
This commit is contained in:
parent
2605bf19cb
commit
1cdaa0a699
5
types/mongoose/index.d.ts
vendored
5
types/mongoose/index.d.ts
vendored
@ -24,6 +24,7 @@
|
||||
// Erik Lopez <https://github.com/niuware>
|
||||
// Vlad Melnik <https://github.com/vladmel1234>
|
||||
// Jarom Loveridge <https://github.com/jloveridge>
|
||||
// Grimmer Kang <https://github.com/grimmer0125>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@ -1935,9 +1936,9 @@ declare module "mongoose" {
|
||||
* 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
|
||||
* @param {Boolean|Object} bool defaults to true
|
||||
*/
|
||||
lean(bool?: boolean): Query<any> & QueryHelpers;
|
||||
lean(bool?: boolean | object): Query<any> & QueryHelpers;
|
||||
|
||||
/** Specifies the maximum number of documents the query will return. Cannot be used with distinct() */
|
||||
limit(val: number): this;
|
||||
|
||||
@ -1199,6 +1199,12 @@ query.
|
||||
sort('-occupation').
|
||||
select('name occupation').
|
||||
exec(cb).then(cb).catch(cb);
|
||||
/**
|
||||
* https://mongoosejs.com/docs/api.html#query_Query-lean
|
||||
*/
|
||||
query.lean() // true
|
||||
query.lean(false)
|
||||
query.lean({})
|
||||
|
||||
/*
|
||||
* section schema/array.js
|
||||
|
||||
Loading…
Reference in New Issue
Block a user