Advertisement
Guest User

mongoose $and error

a guest
Feb 21st, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var temp = '{$and:[{"category.path": /,Mobiles & Accessories,Mobiles,/},{$or: [{"specification.general.brand": "Micromax"},{"specification.general.brand":"Nokia"}]}]}';
  2.         Products.find(temp, function(err, productData) {
  3.             if (err) {  
  4.                 return res.send({info: "Opps sorry"});
  5.             }
  6.             else {
  7.                 //console.log(productData);
  8.                 for (i in productData) {
  9.                     console.log(productData[i].name);
  10.                 }
  11.                 res.json({deals: productData});
  12.             }  
  13.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement