From d527b8a805ed334a52f1d70c344817fd7b27098e Mon Sep 17 00:00:00 2001 From: Christina Papadogianni <59121443+ChrisPdgn@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:26:24 +0300 Subject: [PATCH] fix(database): wrong query in mongoose findOne (#1192) --- .../database/src/adapters/mongoose-adapter/MongooseSchema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts b/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts index bfdf787d5..fca460bfd 100644 --- a/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts +++ b/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts @@ -320,7 +320,7 @@ export class MongooseSchema extends SchemaAdapter> { if (isNil(filter) && !isNil(parsedQuery)) { return null; } - let finalQuery = this.model.findOne(parsedQuery!, options?.select); + let finalQuery = this.model.findOne(filter!, options?.select); if (options?.populate !== undefined && options?.populate !== null) { finalQuery = this.populate(finalQuery, options?.populate); }