update type overloads
This commit is contained in:
parent
eb08105404
commit
c7e60eef48
@ -1,5 +1,5 @@
|
|||||||
import { inspect } from 'node:util';
|
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';
|
import { IServer, ILogger, LoggerClientOptions } from './interfaces/index.js';
|
||||||
|
|
||||||
type Credentials = {
|
type Credentials = {
|
||||||
@ -300,7 +300,9 @@ class MongoDB
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
async findOneAndDelete<T extends Document> (db: string, filter: Document, meta = false)
|
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)
|
if (!this.#db)
|
||||||
throw new Error('MongoDB not connected');
|
throw new Error('MongoDB not connected');
|
||||||
|
Loading…
Reference in New Issue
Block a user