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 a06b1b4310
commit 18671d24b7
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)}`