diff --git a/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts b/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts index 163b868c3..1ae89b34e 100644 --- a/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts +++ b/modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts @@ -313,6 +313,7 @@ export class MongooseSchema extends SchemaAdapter> { options?.userId, options?.scope, ); + if (isNil(parsedQuery)) return null; let finalQuery = this.model.findOne(parsedQuery!, options?.select); if (options?.populate !== undefined && options?.populate !== null) { finalQuery = this.populate(finalQuery, options?.populate);