diff --git a/src/MongoDB.ts b/src/MongoDB.ts index 0ae995f..b96e197 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 } 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))