特定のフィールドのみをモンゴル語で表示


特定のフィールドのみを検索
  • // 유저 정보 조회(유저아이디, 이메일, 유저이름) - 마아페이지
      async getUserInfoById(id: string) {
        const user: any = await this.userModel
          .findById(id)
          .select("userId, email, userName");
        if (!user) throw new HttpError(404, "Not Found UserInfo");
        return user;
      }
  • select()を使用して、対応するフィールドのみをクエリーし、ユーザー
  • に渡すことができます.
  • 低コードではfindById(ID、「userId、email、userName」)形式を使用できます.
    特定フィールド
  • のみクエリー