fix issue with 0 evaluating to false in query builder

This commit is contained in:
Peter Clement 2021-12-15 16:32:04 +00:00
parent 8d57ae93b3
commit 3327c4dc6f
1 changed files with 2 additions and 1 deletions

View File

@ -191,7 +191,8 @@ class QueryBuilder {
}
if (this.query.equal) {
build(this.query.equal, (key, value) => {
if (!value) {
// 0 evaluates to false, which means we would return all rows if we don't check it
if (!value && value !== 0) {
return null
}
return `${key}:${builder.preprocess(value, allPreProcessingOpts)}`