特定のフィールドのみをモンゴル語で表示
484 ワード
特定のフィールドのみを検索例 select()を使用して、対応するフィールドのみをクエリーし、ユーザー に渡すことができます.低コードではfindById(ID、「userId、email、userName」)形式を使用できます.
特定フィールド のみクエリー
// 유저 정보 조회(유저아이디, 이메일, 유저이름) - 마아페이지
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;
}
特定フィールド
Reference
この問題について(特定のフィールドのみをモンゴル語で表示), 我々は、より多くの情報をここで見つけました https://velog.io/@dev_shu/몽구스에서-특정필드만-조회テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol