@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.
- package/lib/Query.js +3 -1
- 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