mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
closes #6499
This commit is contained in:
@@ -13,7 +13,7 @@ module.exports = function (db, module) {
|
||||
{ $group: { _id: null, count: { $sum: 1 } } },
|
||||
];
|
||||
|
||||
db.collection('objects').aggregate(pipeline, function (err, data) {
|
||||
db.collection('objects').aggregate(pipeline).toArray(function (err, data) {
|
||||
callback(err, Array.isArray(data) && data.length ? data[0].count : 0);
|
||||
});
|
||||
};
|
||||
@@ -88,7 +88,7 @@ module.exports = function (db, module) {
|
||||
}
|
||||
pipeline.push({ $project: project });
|
||||
|
||||
db.collection('objects').aggregate(pipeline, function (err, data) {
|
||||
db.collection('objects').aggregate(pipeline).toArray(function (err, data) {
|
||||
if (err || !data) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user