Skip to content

Cannot combine criteria inside .any().with(…) for MongoDB #1623

@harmenweber

Description

@harmenweber

Immutables Criteria for MongoDB seems to have a bug, when you try to find a document with an element inside a nested collection that matches multiple conditions. For example:

person.pets.any()
  .with(pet -> pet.name.is("fluffy").and(pet.type.is(Pet.PetType.gecko)))

Executing such a criterion against an in-memory backend works.
However, running such a criterion against a mongo backend fails with an error like:

ImmutableCall{EQUAL path=getName constant=fluffy} is not a path
java.lang.IllegalArgumentException: ImmutableCall{EQUAL path=getName constant=fluffy} is not a path

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions