node.js - nodejs and mongodb adapter, quering using OR condition -
I am using nodes with Node Adopter, in this way or by using condition to query an archive Try:
var itemFilter = []; ItemFilter.push ({View: True}); If (req.param ('s')) {itemFilter.push ({$ or: [{name: req.param ('s')}, {itemCode: req.param ('s'}}]}}) ;} GSDItem.find (itemFilter) .sort ({'name': 1}) .exec (function (error, response occurs) {item = responses; return callback ();});
Find () Always return an empty array. How can I correctly position OR?
Comments
Post a Comment