ExtJs Code:
tab.getStore().getProxy().setExtraParam("CCP", filterDetails );
tab.getStore().load();
Node.js Code:
exports.loadGrid = function(req, res){
var filteredDetails = req.param('CCP');
console.log(filteredDetails );
mongoClient.connect(config.database.path, function(err, db) {
if(err) throw err;
var collection = db.collection('trades');
// Locate all the entries using find
if(filteredDetails != null)
{
collection.find({$and:[ filteredDetails ]}).toArray(function(err, results) {
console.log(results);
res.send(results);
db.close();
});
}
else
{
collection.find().toArray(function(err, results) {
console.log(results);
res.send(results);
db.close();
});
}
})
};
Here is my result:
[ '[object Object]', '[object Object]' ]
This is the log printed in the console for the code[console.log(filteredDetails );]. Here i want values instead of object.
console.log( JSON.stringify( results ) )and similarly in your send