11 lines
441 B
JavaScript
11 lines
441 B
JavaScript
const mongoose = require('mongoose');
|
|
mongoose.connect('mongodb://backone_inspect:backone_inspect@mongodb.prod.proit.id:27017/backone_inspect_0')
|
|
.then(async (m) => {
|
|
const result = await m.connection.db.collection('countrystats').aggregate([
|
|
{ $match: { agent_uuid: '2F-TF-1D-GK' } },
|
|
{ $group: { _id: '$country_code' } }
|
|
]).toArray();
|
|
console.log('Countries for 2F-TF-1D-GK:', result);
|
|
process.exit(0);
|
|
});
|