ag-grid-mongo-query-builder
Advanced tools
Comparing version 0.1.8 to 0.1.9
{ | ||
"name": "ag-grid-mongo-query-builder", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Utility to generate Mongo DB aggregation pipeline queries starting from AgGrid server side params", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -424,2 +424,8 @@ //const mongoose = require('mongoose'); | ||
console.log('final match query in grouping:',JSON.stringify(_finalMatchQuery)); | ||
const groupProjection = {}; | ||
rowGroupCols.map(groupsCol => { | ||
groupProjection[groupsCol.id] = 1; | ||
}); | ||
let projectionObj = {"$project" : groupProjection}; | ||
const grouingPipelineQuery = [ | ||
@@ -429,6 +435,18 @@ ..._finalMatchQuery, | ||
{"$replaceRoot":{"newRoot":"$doc"}}, | ||
projectionObj | ||
]; | ||
console.log('grouping pipeline:',JSON.stringify(grouingPipelineQuery)); | ||
return grouingPipelineQuery; | ||
// console.log('===============excessIndex'); | ||
// console.log(excessIndex); | ||
// console.log(rowGroupCols.length); | ||
// console.log(groupKeys.length); | ||
if(rowGroupCols.length - groupKeys.length <= 0) { | ||
return [..._finalMatchQuery]; | ||
} else { | ||
return grouingPipelineQuery; | ||
} | ||
// console.log('grouping pipeline:',JSON.stringify(grouingPipelineQuery)); | ||
// return grouingPipelineQuery; | ||
} | ||
@@ -435,0 +453,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20610
424