Using mongoose
you can do this using findOne
:
yourModel.findOne({level:3},{id:1}).then(result => {
console.log("result = ",result.id)
}).catch(e => {
// error
})
Response is 553
Example how mongo query works here. This example output an array but ising findOne
only one value will be returned, so you can do response.name
directly and get the value.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…