Ensure WHERE conditions are computed correctly

This commit is contained in:
Tobie Morgan Hitchcock 2022-04-06 20:28:16 +01:00
parent 2b89702490
commit f6b47d381b

View file

@ -15,8 +15,8 @@ impl<'a> Document<'a> {
) -> Result<(), Error> { ) -> Result<(), Error> {
// Check where condition // Check where condition
if let Some(cond) = stm.conds() { if let Some(cond) = stm.conds() {
if cond.expr.compute(ctx, opt, txn, Some(&self.current)).await?.is_truthy() {
// Check if the expression is truthy // Check if the expression is truthy
if !cond.expr.compute(ctx, opt, txn, Some(&self.current)).await?.is_truthy() {
// Ignore this document // Ignore this document
return Err(Error::Ignore); return Err(Error::Ignore);
} }