Revert "feat: grouped query builder with $upIf/$downIf condition groups"
This reverts commit 99b59070a2.
This commit is contained in:
@@ -50,17 +50,6 @@ pub struct Response {
|
||||
pub fn evaluate(query: &Value, response: &Response) -> Result<bool> {
|
||||
match query {
|
||||
Value::Object(map) => {
|
||||
// $upIf / $downIf — named groups, $downIf takes precedence
|
||||
if map.contains_key("$upIf") || map.contains_key("$downIf") {
|
||||
if let Some(down) = map.get("$downIf") {
|
||||
if evaluate(down, response).unwrap_or(false) { return Ok(false); }
|
||||
}
|
||||
if let Some(up) = map.get("$upIf") {
|
||||
return evaluate(up, response);
|
||||
}
|
||||
return Ok(true); // only $downIf set and didn't match → up
|
||||
}
|
||||
|
||||
// $and / $or / $not
|
||||
if let Some(and) = map.get("$and") {
|
||||
let Value::Array(clauses) = and else { bail!("$and expects array") };
|
||||
|
||||
Reference in New Issue
Block a user