From e372b2ed373e1fb4096416a8eab49f893140d14b Mon Sep 17 00:00:00 2001 From: Staffan Eketorp Date: Thu, 17 Mar 2022 10:11:32 -0700 Subject: [PATCH] NODE-4095 - hard to use findOne with filter https://www.mongodb.com/community/forums/t/mongodb-4-1-4-with-typescript-findone-syntax-error-type-void-is-not-assignable-to-type-dbuser-undefined-ts-2322/131533 --- src/collection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/collection.ts b/src/collection.ts index 81be9fe3ee..1c2545831f 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -693,8 +693,8 @@ export class Collection { * @param callback - An optional callback, a Promise will be returned if none is provided */ findOne(): Promise | null>; - findOne(callback: Callback | null>): void; findOne(filter: Filter): Promise | null>; + findOne(callback: Callback | null>): void; findOne(filter: Filter, callback: Callback | null>): void; findOne(filter: Filter, options: FindOptions): Promise | null>; findOne( @@ -705,8 +705,8 @@ export class Collection { // allow an override of the schema. findOne(): Promise; - findOne(callback: Callback): void; findOne(filter: Filter): Promise; + findOne(callback: Callback): void; findOne(filter: Filter, options?: FindOptions): Promise; findOne( filter: Filter,