Compare commits

...

2 Commits

Author SHA1 Message Date
Alexander Chan 53f4746868 test 2018-07-01 12:08:07 -07:00
Alexander Chan 31b25909b6 bf: fix mongo aggregate 2018-07-01 00:37:02 -07:00
2 changed files with 12 additions and 7 deletions

View File

@ -1280,15 +1280,20 @@ class MongoClientInterface {
} },
];
return c.aggregate([
{ $project: reducedFields },
{ $match: filter },
{ $facet: {
const facetOp = {
count: aggCount,
data: aggData,
repData: aggRepData,
compData: isTransient ? aggCompleted : undefined,
} },
};
if (isTransient) {
facetOp.compData = aggCompleted;
}
return c.aggregate([
{ $project: reducedFields },
{ $match: filter },
{ $facet: facetOp },
]).toArray((err, res) => {
if (err) {
log.error('Error when processing mongo entries', {

View File

@ -3,7 +3,7 @@
"engines": {
"node": ">=6.9.5"
},
"version": "8.0.0",
"version": "8.0.7",
"description": "Common utilities for the S3 project components",
"main": "index.js",
"repository": {