From 988edf96cbe520471bdd0562c2ced23c4e7d7d04 Mon Sep 17 00:00:00 2001 From: Dawid Kisielewski Date: Tue, 12 Dec 2023 10:26:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Use=20countDocuments=20for=20mon?= =?UTF-8?q?go=20query=20instead=20of=20count?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The count is deprecated we should use countDocuments --- package.json | 2 +- src/resource.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 27af675..c7c9eba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adminjs/mongoose", - "version": "4.0.0-reedsy-0.0.1", + "version": "4.0.0-reedsy-1.0.0", "description": "Mongoose adapter for adminjs", "type": "module", "exports": { diff --git a/src/resource.ts b/src/resource.ts index ebf64a7..b611910 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -68,7 +68,7 @@ class Resource extends BaseResource { async count(filters = null) { if (Object.keys(convertFilter(filters)).length > 0) { - return this.MongooseModel.count(convertFilter(filters)) + return this.MongooseModel.countDocuments(convertFilter(filters)) } return this.MongooseModel.estimatedDocumentCount() }