【发布时间】:2021-05-18 12:09:13
【问题描述】:
我在密码上应用了隐藏属性:
@Column({nullable: true, select: false})
password: string;
登录时我需要输入密码。所以根据他documentation 我可以通过使用选择这个隐藏值:
const qb = getConnection().createQueryBuilder()
const user = await qb
.select("password", "password")
.from(User, 'user')
.where("password = :password", {
password: password
})
.addSelect('password', 'password')
.getOne()
这样做我得到undefined 并且password 属性仍然隐藏。
如何在我的情况下获取隐藏值?
【问题讨论】: