diff --git a/src/select/expr_term.rs b/src/select/expr_term.rs index e64df4ce..15c23431 100644 --- a/src/select/expr_term.rs +++ b/src/select/expr_term.rs @@ -168,6 +168,7 @@ where for result_value in &ret { if (*map_value).eq(*result_value) { tmp.push(*rel_value); + break; } } } diff --git a/tests/array_filter.rs b/tests/array_filter.rs index 9ffa79ed..3c52a85c 100644 --- a/tests/array_filter.rs +++ b/tests/array_filter.rs @@ -250,4 +250,42 @@ fn bugs40_bracket_notation_after_recursive_descent() { "more" ]), ); -} \ No newline at end of file +} + +#[test] +fn bugs92_duplicate_result_similar_indernal_values() { + setup(); + + select_and_then_compare( + "$[?(@.name.first=='A')]", + json!([ + { + "name":{ + "first":"A" + } + }, + { + "name":{ + "first":"A" + } + }, + { + "name":{ + "first":"B" + } + } + ]), + json!([ + { + "name":{ + "first":"A" + } + }, + { + "name":{ + "first":"A" + } + } + ]), + ); +}