我有以下selection query
,它应该根据用户document
和email
输入返回整个password
(基本上我正在尝试登录),{ {1}}负责result
。怎么了?
null
用户集合架构:
user.loginUser = (jUserData, fCallback) => {
var jUser = {
userName: jUserData.txtEmailorPhoneNumber,
password: jUserData.txtPassword
}
global.db.collection('users').findOne({ jUser }, (err, result) => {
if (err) {
var jError = { "status": "error", "message": "ERROR -> loginUser -> user.js -> 001" }
return fCallback(false, jError)
}
var jOk = { "status": "ok", "message": "user.js -> user logged in -> 000" }
console.log(JSON.stringify(result))
return fCallback(false, jOk)
})
}
答案 0 :(得分:1)
尝试使用findOne(jUser,...)而不是findOne({jUser},...)