From c7e60eef4888ee49352bef025f62271a8380e7ef Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 16 Aug 2023 03:20:45 +0300 Subject: [PATCH] update type overloads --- src/MongoDB.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MongoDB.ts b/src/MongoDB.ts index 3c4f8dd..838e7ba 100644 --- a/src/MongoDB.ts +++ b/src/MongoDB.ts @@ -1,5 +1,5 @@ import { inspect } from 'node:util'; -import { MongoClient, MongoClientOptions, Db, Document, WithId, ObjectId, Filter, IndexSpecification, CreateIndexesOptions, FindOptions } from 'mongodb'; +import { MongoClient, MongoClientOptions, Db, Document, WithId, ObjectId, Filter, IndexSpecification, CreateIndexesOptions, FindOptions, ModifyResult } from 'mongodb'; import { IServer, ILogger, LoggerClientOptions } from './interfaces/index.js'; type Credentials = { @@ -300,7 +300,9 @@ class MongoDB return result; } - async findOneAndDelete (db: string, filter: Document, meta = false) + async findOneAndDelete (db: string, filter: Document, meta: false): Promise> + async findOneAndDelete (db: string, filter: Document, meta: true): Promise> + async findOneAndDelete (db: string, filter: Document, meta = false) { if (!this.#db) throw new Error('MongoDB not connected');