I am getting array from angular controller like [ 
'572b2e5d63f338b02afa36b9', '572b3da2034e6370301943bc' ] to node. 

Below code is my node

router.get('/purchaserInfo',function(req,res){
console.log(req.query.proID);
var productId = req.query.proID;
var findPurchaserInfo = function(db, callback) {
var cursor 
=db.collection('purchased').find({purchasedItemID:productId}).toArray(function(err,
 
docs){
if(err){  
callback(new Error("Some problem"));
}else{
callback(null,docs);
} 
});
};
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
findPurchaserInfo(db, function(err,docs) {
db.close();
if(err) return res.json({result:null})
else
return res.json({result: docs});
});
}); 
});



I want both product id to search but it takes only last one.How to solve 
this.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/c5f6877a-8f74-424a-92cc-5a36c707ee62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to