Skip to content

Duplicate results no filter #92

@gkorland

Description

@gkorland

Filter might return duplicate results when the internal objects are similar.

e.g. input JSON both objects have name == {"first":"A","middle":"A"}

[{{"name":{"first":"A","middle":"A"},"rank":8},{"name":{"first":"A","middle":"A"},"rank":90}]

When running:

$[?($.name.first=="A")]

The following result is returned:

[{{"name":{"first":"A","middle":"A"},"rank":8},{"name":{"first":"A","middle":"A"},"rank":8},{{"name":{"first":"A","middle":"A"},"rank":90},{"name":{"first":"A","middle":"A"},"rank":90}]

It seems like the bug is in this code which compares all the candidates with all values and return each "parent" twice.

for result_value in &ret {

ref RedisJSON/RedisJSON#667

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