diff --git a/packages/core/database/lib/query/query-builder.js b/packages/core/database/lib/query/query-builder.js index 1fe6bcfb3b..043bc26a22 100644 --- a/packages/core/database/lib/query/query-builder.js +++ b/packages/core/database/lib/query/query-builder.js @@ -110,37 +110,37 @@ const createQueryBuilder = (uid, db) => { init(params = {}) { const { _q, where, select, limit, offset, orderBy, groupBy, populate } = params; - if (where) { + if (!_.isNil(where)) { this.where(where); } - if (_q) { + if (!_.isNil(_q)) { this.search(_q); } - if (select) { + if (!_.isNil(select)) { this.select(select); } else { this.select('*'); } - if (limit) { + if (!_.isNil(limit)) { this.limit(limit); } - if (offset) { + if (!_.isNil(offset)) { this.offset(offset); } - if (orderBy) { + if (!_.isNil(orderBy)) { this.orderBy(orderBy); } - if (groupBy) { + if (!_.isNil(groupBy)) { this.groupBy(groupBy); } - if (populate) { + if (!_.isNil(populate)) { this.populate(populate); }