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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -