Socket
Socket
Sign inDemoInstall

ag-grid-mongo-query-builder

Package Overview
Dependencies
0
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.7 to 0.3.8

2

package.json
{
"name": "ag-grid-mongo-query-builder",
"version": "0.3.7",
"version": "0.3.8",
"description": "Utility to generate Mongo DB aggregation pipeline queries starting from AgGrid server side params",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -939,32 +939,49 @@ //const mongoose = require('mongoose');

const response = await Promise.all(requests);
console.log('------Export Response Length');
console.log(response.length);
if(response && response.length > 0) {
console.log('------------Keys');
console.log(keys);
response.map(eachRes => {
console.log('------Each batch Response Length');
console.log(eachRes.length);
eachRes.map(function(obj) {
let tempDataObj = {};
for (let i in keys) {
if (obj[keys[i].fieldName] && Array.isArray(obj[keys[i].fieldName])) {
tempDataObj[keys[i].fieldName] = obj[keys[i].fieldName].toString();
} else if (keys[i].dataType && (obj[keys[i].fieldName] == "" || obj[keys[i].fieldName] == null || obj[keys[i].fieldName] == undefined)) {
tempDataObj[keys[i].fieldName] = "";
} else if(keys[i].dataType) {
tempDataObj[keys[i].fieldName] = obj[keys[i].fieldName];
}
if(Object.keys(obj).length > 0) {
for (let i in keys) {
if(keys[i].dataType === 'agDateColumnFilter') {
const dateVal = obj[keys[i].fieldName] ? new Date(obj[keys[i].fieldName]) : null;
if(dateVal) {
tempDataObj[keys[i].fieldName] = moment(dateVal).format("DD/MM/YYYY");
if (obj[keys[i].fieldName] && Array.isArray(obj[keys[i].fieldName])) {
tempDataObj[keys[i].fieldName] = obj[keys[i].fieldName].toString();
} else if (keys[i].dataType && (obj[keys[i].fieldName] == "" || obj[keys[i].fieldName] == null || obj[keys[i].fieldName] == undefined)) {
tempDataObj[keys[i].fieldName] = "";
} else if(keys[i].fieldName) {
tempDataObj[keys[i].fieldName] = obj[keys[i].fieldName];
} else {
console.log('-----------key value not found in each resposne');
console.log(JSON.stringify(obj));
tempDataObj[keys[i].fieldName] = "";
}
if(keys[i].dataType === 'agDateColumnFilter') {
const dateVal = obj[keys[i].fieldName] ? new Date(obj[keys[i].fieldName]) : null;
if(dateVal) {
tempDataObj[keys[i].fieldName] = moment(dateVal).format("DD/MM/YYYY");
}
}
}
}
flagValue.map(eachVal => {
let match = false;
flagColumns.some(flagCol => {
const typeOfVal = typeof(obj[flagCol.field]);
match = checkFlagCondition(typeOfVal, eachVal, obj[flagCol.field]);
if(match) return match
});
tempDataObj[`Keyword - ${eachVal}`] = match ? '1' : '0';
})
flagValue.map(eachVal => {
let match = false;
flagColumns.some(flagCol => {
const typeOfVal = typeof(obj[flagCol.field]);
match = checkFlagCondition(typeOfVal, eachVal, obj[flagCol.field]);
if(match) return match
});
tempDataObj[`Keyword - ${eachVal}`] = match ? '1' : '0';
})
} else {
console.log('------------No key found in each resposne obj');
}
finalExportResultArray.push(tempDataObj);

@@ -1021,2 +1038,5 @@ });

console.log('---------------Export Batch Query');
console.log(JSON.stringify(query));
return await query.exec().then((results) => {

@@ -1023,0 +1043,0 @@ return results;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc