@ewb/mongoose-query 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/Query.js +3 -1
  2. package/package.json +1 -1
package/lib/Query.js CHANGED
@@ -204,11 +204,13 @@ export class Query {
204
204
  for (const key in query) {
205
205
  if (query.hasOwnProperty(key)) {
206
206
  const str = String(query[key]);
207
+ if (!str)
208
+ continue;
207
209
  if (key[0] === '$') {
208
210
  if (typeof query[key] !== 'string')
209
211
  continue;
210
212
  const { field, value } = mongooseQueryWithOperation(operationQuery, key, str);
211
- if (field) {
213
+ if (field && value) {
212
214
  operationQuery[field] = value;
213
215
  }
214
216
  delete query[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ewb/mongoose-query",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "description": "Parse queries and params to mongoose search. Strips dangerous keys and set corrects options with help of query values.",
6
6
  "main": "./lib/index.js",