diff --git a/db/fetch.go b/db/fetch.go index 43e71d42..c8a48e7e 100644 --- a/db/fetch.go +++ b/db/fetch.go @@ -233,6 +233,17 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o return nil, err } + switch val.Op { + case sql.OR: + if calcAsBool(l) { + return true, nil + } + case sql.AND: + if !calcAsBool(l) { + return false, nil + } + } + r, err := e.fetch(ctx, val.RHS, doc) if err != nil { return nil, err