smc-mongoose-query-builder-helper
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "smc-mongoose-query-builder-helper", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Query builder helper for mongoose", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -28,10 +28,10 @@ # SMC Mongoose Query Builder Helper | ||
// as an ObjectId which refers to departments collection | ||
query = queryBuilder.objectIdMatcher(quey, 'department', req.query.department); | ||
query = queryBuilder.objectIdMatcher(query, 'department', req.query.department); | ||
// If you want to match an exact value. eg: the age of a person | ||
query = queryBuilder.valueMatcher(quey, 'age', req.query.age); | ||
query = queryBuilder.valueMatcher(query, 'age', req.query.age); | ||
// If you want to match a pattern. eg: search for a name by providing | ||
// one or two letters of that name. | ||
query = queryBuilder.patternMatcher(quey, 'name', req.query.name); | ||
query = queryBuilder.patternMatcher(query, 'name', req.query.name); | ||
@@ -42,3 +42,3 @@ // If you want to find an opposite case of above patternMatcher. | ||
// to find all non deleted users) | ||
query = queryBuilder.patternUnMatcher(quey, 'status', req.query.status); | ||
query = queryBuilder.patternUnMatcher(query, 'status', req.query.status); | ||
@@ -49,7 +49,7 @@ // If you want to check whether your data values is one of among given set | ||
const managerialRoles = ['senior_manager', 'manager', 'managerial_executive']; | ||
query = queryBuilder.arrayElementMatcher(quey, 'user_role', managerialRoles); | ||
query = queryBuilder.arrayElementMatcher(query, 'user_role', managerialRoles); | ||
// If you want to find a numeric field that contains a given number | ||
eg: you want to find users whose phone numbers contains '1234' | ||
query = queryBuilder.numberPatternMatcher(quey, 'phone_number', 1234); | ||
query = queryBuilder.numberPatternMatcher(query, 'phone_number', 1234); | ||
@@ -56,0 +56,0 @@ // For further query buildings, |
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
14205