Skip to content

Filter with OR expression fails with non-existing value #87

Description

@oshadmi

Adding a test such as the following, fails when a filter contains an OR expression with one of its operands being compared to a none-existing value, e.g.,
Slightly modifying an existing test named op_object_or_default in op.rs:

#[test]
fn op_object_or_nonexisting_default() {
    setup();

    select_and_then_compare(
        "$.friends[?(@.id >= 2 || @.id == 4)]",
        read_json("./benchmark/data_obj.json"),
        json!([
            { "id" : 2, "name" : "Gray Berry" }
        ]),
    );
}

The selected result is empty, while it should be equal to the target json.

When removing the right operand || @.id == 4 it succeeds
(with filter "$.friends[?(@.id >= 2)]" )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions