NeDB: projection is not T (#47460)

`projection` is a MongoDB-style projection.
Possible values include `{_id: 0}` and `{'foo.bar': 1}`. This does not mean that `T` will be an object that has either of those properties nor that their are numbers. `1` means to include the property in the return value and `0` means to leave the property out.
This commit is contained in:
Christian Paul 2020-09-11 18:28:48 +02:00 committed by GitHub
parent 15ea8d2115
commit 7f3c3f89ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,8 +96,8 @@ declare class Nedb<G = any> extends EventEmitter {
* @param query MongoDB-style query
* @param projection MongoDB-style projection
*/
find<T extends G>(query: any, projection: T, callback: (err: Error | null, documents: T[]) => void): void;
find<T extends G>(query: any, projection?: T): Nedb.Cursor<T>;
find<T extends G>(query: any, projection: any, callback: (err: Error | null, documents: T[]) => void): void;
find<T extends G>(query: any, projection?: any): Nedb.Cursor<T>;
/**
* Find all documents matching the query
@ -111,7 +111,7 @@ declare class Nedb<G = any> extends EventEmitter {
* @param query MongoDB-style query
* @param projection MongoDB-style projection
*/
findOne<T extends G>(query: any, projection: T, callback: (err: Error | null, document: T) => void): void;
findOne<T extends G>(query: any, projection: any, callback: (err: Error | null, document: T) => void): void;
/**
* Find one document matching the query