update type overloads

This commit is contained in:
Erik 2023-08-16 03:20:45 +03:00
parent eb08105404
commit c7e60eef48
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68

View File

@ -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,6 +300,8 @@ class MongoDB
return result;
}
async findOneAndDelete<T extends Document> (db: string, filter: Document, meta: false): Promise<WithId<T>>
async findOneAndDelete<T extends Document> (db: string, filter: Document, meta: true): Promise<ModifyResult<T>>
async findOneAndDelete<T extends Document> (db: string, filter: Document, meta = false)
{
if (!this.#db)