mongoose icon indicating copy to clipboard operation
mongoose copied to clipboard

BUG: Wrong callback result type in ts definition

Open creativearmenia opened this issue 6 years ago • 0 comments

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

creativearmenia avatar Dec 04 '20 06:12 creativearmenia