Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
oshadmi opened this issue Jan 17, 2022 · 0 comments
Open

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

oshadmi opened this issue Jan 17, 2022 · 0 comments

Comments

@oshadmi
Copy link
Contributor

oshadmi commented Jan 17, 2022

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)]" )

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant