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([ const facetOp = {
{ $project: reducedFields },
{ $match: filter },
{ $facet: {
count: aggCount, count: aggCount,
data: aggData, data: aggData,
repData: aggRepData, repData: aggRepData,
compData: isTransient ? aggCompleted : undefined, };
} },
if (isTransient) {
facetOp.compData = aggCompleted;
}
return c.aggregate([
{ $project: reducedFields },
{ $match: filter },
{ $facet: facetOp },
]).toArray((err, res) => { ]).toArray((err, res) => {
if (err) { if (err) {
log.error('Error when processing mongo entries', { log.error('Error when processing mongo entries', {

View File

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