Skip to content

alike Criteria can't add andOperator #3544

Closed
@kioyong

Description

@kioyong

refer below code, It's work on spring-data-mongoDB 2.1.7.RELEASE, expect aFilter and bFilter will apply in query, but after upgrade to latest version(2.4.2), only bFilter work and aFilter will be ignore.

Query query = new Query(new Criteria().alike(Example.of(aFilter)).andOperator(new Criteria(bFilter).is("bValue")));

there are workaround in my code is using query().addCriteria to replace criteria.andOperator()

Query query = new Query(new Criteria().alike(Example.of(aFilter))).addCriteria(new Criteria("bFilter").is("bValue"));

i believe this bug is caused by DATAMONGO-2314 removed .alike criteriaChain of code, please help to check, thanks.

this is reproduce issue example: https://github.com/kioyong/spring-data-mongodb-bug
just need to run mvn test to reproduce it.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions