viewmodel
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -45,2 +45,12 @@ 'use strict'; | ||
function getInTerms (query) { | ||
return _(query).keys().filter(function (k) { | ||
return _.isPlainObject(query[k]) && query[k].$in; | ||
}).map(function (k) { | ||
var term = {}; | ||
term[k] = query[k].$in; | ||
return { term: term }; | ||
}).value(); | ||
} | ||
function getRanges (query) { | ||
@@ -214,2 +224,9 @@ return _(query).keys().filter(function (k) { | ||
var orInTerms = getInTerms(ele); | ||
if (orInTerms.length > 0) { | ||
body.query.filtered.filter.or = body.query.filtered.filter.or || []; | ||
body.query.filtered.filter.or = body.query.filtered.filter.or.concat(orInTerms); | ||
} | ||
var orRanges = getRanges(ele); | ||
@@ -233,2 +250,9 @@ | ||
var andInTerms = getInTerms(ele); | ||
if (andInTerms.length > 0) { | ||
body.query.filtered.filter.and = body.query.filtered.filter.and || []; | ||
body.query.filtered.filter.and = body.query.filtered.filter.and.concat(andInTerms); | ||
} | ||
var andRanges = getRanges(ele); | ||
@@ -249,2 +273,9 @@ | ||
var inTerms = getInTerms(query); | ||
if (inTerms.length > 0) { | ||
body.query.filtered.filter.and = body.query.filtered.filter.and || []; | ||
body.query.filtered.filter.and = body.query.filtered.filter.and.concat(inTerms); | ||
} | ||
var ranges = getRanges(query); | ||
@@ -251,0 +282,0 @@ |
{ | ||
"author": "adrai", | ||
"name": "viewmodel", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"private": false, | ||
@@ -14,3 +14,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"async": "1.3.0", | ||
"async": "1.4.0", | ||
"dotty": "0.0.2", | ||
@@ -20,3 +20,3 @@ "jsondate": "0.0.1", | ||
"node-uuid": "1.4.3", | ||
"sift": "2.0.0", | ||
"sift": "2.0.3", | ||
"tolerance": "1.0.0" | ||
@@ -23,0 +23,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
## [v1.4.1](https://github.com/adrai/node-viewmodel/compare/v1.3.4...v1.4.1) | ||
## [v1.4.2](https://github.com/adrai/node-viewmodel/compare/v1.3.4...v1.4.2) | ||
- added elasticsearch support | ||
@@ -3,0 +3,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
97711
2683
+ Addedasync@1.4.0(transitive)
+ Addedsift@2.0.3(transitive)
- Removedasync@1.3.0(transitive)
- Removedsift@2.0.0(transitive)
Updatedasync@1.4.0
Updatedsift@2.0.3