Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ag-grid-mongo-query-builder

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ag-grid-mongo-query-builder - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

2

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

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

@@ -35,3 +35,3 @@ //const mongoose = require('mongoose');

const filterQuery = isFiltering ? buildFilterQuery(filterModel) : [];
const filterQuery = isFiltering ? buildFilterQuery(filterModel, isGrouping) : [];
const quickSearchQuery = isQuickSearch && quickFilter ? buildQuickSearchQuery(column, quickFilter) : [];

@@ -113,3 +113,3 @@ const flagSearchQuery = isFlagSearch && flagFilters.length >0 ? buildFlagQuery(flagColumns, flagFilters) : [];

const filterQuery = isFiltering ? buildFilterQuery(filterModel) : [];
const filterQuery = isFiltering ? buildFilterQuery(filterModel, isGrouping) : [];
const quickSearchQuery = isQuickSearch && quickFilter ? buildQuickSearchQuery(column, quickFilter) : [];

@@ -160,9 +160,11 @@ const flagSearchQuery = isFlagSearch && flagFilters.length >0 ? buildFlagQuery(flagColumns, flagFilters) : [];

function buildFilterQuery(filterModel) {
function buildFilterQuery(filterModel, isGrouping) {
const columns = Object.keys(filterModel);
const addFieldArr = [];
const query = columns.map(column => {
const addFieldObj = { $addFields: { }};
addFieldObj.$addFields[`${column}Type`] = { $type: `$${column}` };
addFieldArr.push(addFieldObj);
if(isGrouping) {
const addFieldObj = { $addFields: { }};
addFieldObj.$addFields[`${column}Type`] = { $type: `$${column}` };
addFieldArr.push(addFieldObj);
}
return buildColumnQuery(filterModel[column], column)

@@ -169,0 +171,0 @@ });

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc