mongo index specification type
This commit is contained in:
parent
687494727b
commit
3f9cdc2d69
@ -1,5 +1,5 @@
|
||||
import { inspect } from "node:util";
|
||||
import { MongoClient, MongoClientOptions, Db, Document, WithId, ObjectId, Filter } from "mongodb";
|
||||
import { MongoClient, MongoClientOptions, Db, Document, WithId, ObjectId, Filter, IndexSpecification } from "mongodb";
|
||||
import { IServer, ILogger, LoggerClientOptions } from "./interfaces/index.js";
|
||||
|
||||
type Credentials = {
|
||||
@ -327,7 +327,7 @@ class MongoDB {
|
||||
return this.#db.collection(coll);
|
||||
}
|
||||
|
||||
async ensureIndex (collection: string, indices: string[] = []) {
|
||||
async ensureIndex (collection: string, indices: IndexSpecification = []) {
|
||||
if (!this.#db)
|
||||
throw new Error(`MongoDB not connected`);
|
||||
if (!(indices instanceof Array))
|
||||
|
Loading…
Reference in New Issue
Block a user