Skip to content

alike Criteria can't add andOperator #3544

New issue

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

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

Already on GitHub? Sign in to your account

Closed
kioyong opened this issue Jan 24, 2021 · 1 comment
Closed

alike Criteria can't add andOperator #3544

kioyong opened this issue Jan 24, 2021 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@kioyong
Copy link
Contributor

kioyong commented Jan 24, 2021

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 24, 2021
@christophstrobl christophstrobl self-assigned this Jan 27, 2021
@christophstrobl christophstrobl added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 27, 2021
@christophstrobl
Copy link
Member

Thanks for reporting - we'll look into this.

@mp911de mp911de changed the title [bug] alike Criteria can't add andOperator, alike Criteria can't add andOperator Feb 1, 2021
mp911de pushed a commit that referenced this issue Feb 1, 2021
This commit fixes an issue where an Example probe would not be added to the criteria chain.

Closes #3544
Original pull request: #3549.
@mp911de mp911de added this to the 2.2.13 (Moore SR13) milestone Feb 1, 2021
@mp911de mp911de closed this as completed in e644692 Feb 1, 2021
mp911de pushed a commit that referenced this issue Feb 1, 2021
This commit fixes an issue where an Example probe would not be added to the criteria chain.

Closes #3544
Original pull request: #3549.
mp911de pushed a commit that referenced this issue Feb 1, 2021
This commit fixes an issue where an Example probe would not be added to the criteria chain.

Closes #3544
Original pull request: #3549.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants