Revert "feat: grouped query builder with $upIf/$downIf condition groups"

This reverts commit 99b59070a2.
This commit is contained in:
M1
2026-03-16 13:53:27 +04:00
parent 99b59070a2
commit 5328471229
4 changed files with 3 additions and 168 deletions
-11
View File
@@ -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") };