我如何通过而不是在下面'n'
硬编码?'5'
Xcom.find({ $where : "this.NIC_No == '5'" }
exports.query_by_nic = function ( req, res ){
var n = req.body.NIC_No;
console.log(n); //n prints correctly as expected
Xcom.find({ $where : "this.NIC_No == '5'" }, function ( err, xcoms ){ //works with '5' but how do I query for 'n'?
res.render( 'query_by_nic', {
title : 'Query by NIC',
xcoms : xcoms
});
console.log(err);
console.log(xcoms);
});
};