From 040856e57b5464778edc46ac75c42ae00134abc1 Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 25 Apr 2023 21:24:43 +0800 Subject: [PATCH] fix: autopopulate note Signed-off-by: Innei --- src/processors/database/database.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/processors/database/database.service.ts b/src/processors/database/database.service.ts index d120b89f..03dd5f48 100644 --- a/src/processors/database/database.service.ts +++ b/src/processors/database/database.service.ts @@ -82,7 +82,10 @@ export class DatabaseService { public async findGlobalById(id: string) { const doc = await Promise.all([ this.postModel.findById(id).populate('category').lean(), - this.noteModel.findById(id).lean().select('+password'), + this.noteModel + .findById(id) + .lean({ autopopulate: true }) + .select('+password'), this.pageModel.findById(id).lean(), this.recentlyModel.findById(id).lean(), ])