mongoose
mongoose copied to clipboard
BUG: Wrong callback result type in ts definition
Bug Report
seems wrong type for find query result when using callback, it is count: number
/** Creates a `find` query: gets a list of documents that match `filter`. */
find(callback?: (err: any, count: number) => void): Query<Array<T>, T>;
find(filter: FilterQuery<T>, callback?: (err: any, count: number) => void): Query<Array<T>, T>;
find(filter: FilterQuery<T>, projection?: any | null, options?: QueryOptions | null, callback?: (err: any, count: number) => void): Query<Array<T>, T>;
/** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */
distinct(field: string, filter?: FilterQuery<T>, callback?: (err: any, count: number) => void): Query<Array<any>, T>;
and additional call for find with filter, projection and callback without options