From c0eae8be4bb81293637118c9fa4c7ea4113131f7 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 15 May 2023 15:06:46 +0300 Subject: [PATCH] type params for methods --- src/MongoDB.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MongoDB.ts b/src/MongoDB.ts index e2910e9..e23558b 100644 --- a/src/MongoDB.ts +++ b/src/MongoDB.ts @@ -301,7 +301,7 @@ class MongoDB { * @returns {object} * @memberof Database */ - random (db: string, filter: Document = {}, amount = 1) { + random (db: string, filter: Document = {}, amount = 1) { if (!this.#db) throw new Error(`MongoDB not connected`); @@ -315,7 +315,7 @@ class MongoDB { if (amount > 100) amount = 100; - const cursor = this.#db.collection(db).aggregate([{ $match: filter }, { $sample: { size: amount } }]); + const cursor = this.#db.collection(db).aggregate([{ $match: filter }, { $sample: { size: amount } }]); return cursor.toArray(); } @@ -327,10 +327,10 @@ class MongoDB { return result; } - collection (coll: string) { + collection (coll: string) { if (!this.#db) throw new Error(`MongoDB not connected`); - return this.#db.collection(coll); + return this.#db.collection(coll); } count (coll: string, query: Document) {