From ab9985c833c10b93d522fd7123631f10d12d91b1 Mon Sep 17 00:00:00 2001 From: DaddyWarbucks Date: Thu, 10 Oct 2024 14:43:01 -0500 Subject: [PATCH] Handle ro results --- packages/mongodb/src/adapter.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/mongodb/src/adapter.ts b/packages/mongodb/src/adapter.ts index f25c0ceeb..2b4a2036a 100644 --- a/packages/mongodb/src/adapter.ts +++ b/packages/mongodb/src/adapter.ts @@ -225,6 +225,9 @@ export class MongoDbAdapter< } } const [result] = await this.aggregateRaw(aggregateParams).then((result) => result.toArray()) + if (!result) { + return 0 + } return result.total }