Replace Filter class with expression structure
This is in order to be able to support UPPER() and LOWER() functions in queries which are needed for case-insensitive search.
This commit is contained in:
1 parent
7194fcab44
commit
c2d13e8364
25 files changed
+716
-578
No files matched your search
+4
-2
@@ -20,7 +20,8 @@ function getClient() {
|
||||
|
||||
function query(resource, filter, limit, skip, callback) {
|
||||
let q;
|
||||
if (filter && filter.ast) q = apiFunctions.filterToMongoQuery(filter.ast);
|
||||
if (Array.isArray(filter)) q = apiFunctions.filterToMongoQuery(filter);
|
||||
else if (filter != null && !filter) return Promise.resolve([]);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
getClient().then(client => {
|
||||
@@ -50,7 +51,8 @@ function query(resource, filter, limit, skip, callback) {
|
||||
|
||||
function count(resource, filter) {
|
||||
let q;
|
||||
if (filter && filter.ast) q = apiFunctions.filterToMongoQuery(filter.ast);
|
||||
if (Array.isArray(filter)) q = apiFunctions.filterToMongoQuery(filter);
|
||||
else if (filter != null && !filter) return Promise.resolve([]);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
getClient().then(client => {
|
||||
|
||||
Reference in new issue
Block a user