'Mongodb Nodejs Aggregration query
I am using the below code for a aggregate query. However, I am unable to parse the result. Any help will be highly appreciated.
MongoClient.connect(
'mongodb://192.168.1.136:27017/?readPreference=primary&appname=MongoDB%20Compass&ssl=false',
{ useNewUrlParser: true, useUnifiedTopology: true },
function(connectErr, client) {
assert.equal(null, connectErr);
const coll = client.db('kaa').collection('logs_96775772132708234336');
coll.aggregate(agg, (cmdErr, result) => {
if (cmdErr) throw err;
console.log(result);
client.close();
});
});
Thanks And Regards,
Rupak Banerjee.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
