const dbs = fastify.mongo.db;
dbs.collection('patients', onCollectionss);
function onCollectionss(err, col) {
if (err) return reply.send(err);
col.aggregate(
{
$group: {
_id: '$dataset.0020000D.Value',
num_tutorial: { $sum: 1 },
md5hash: { $first: '$dataset.00080060.Value' },
},
},
(error, body) => {
if (!error) {
console.log('223', body);
resolve(body);
} else {
console.log('226', error);
reject(error);
}
}
);
}
it’s not show any data