From 3f9cdc2d698ca5f4f6770164d7ad22cde645450b Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 30 Apr 2023 22:34:47 +0300 Subject: [PATCH] mongo index specification type --- src/MongoDB.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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))