Skip to content
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

mongo-java-server's collation doesn't work #224

Open
gregecho opened this issue Aug 29, 2023 · 1 comment
Open

mongo-java-server's collation doesn't work #224

gregecho opened this issue Aug 29, 2023 · 1 comment

Comments

@gregecho
Copy link

Hi there,

I'm using testImplementation group: 'de.bwaldvogel', name: 'mongo-java-server', version: '1.44.0' with Springboot 3.1.1. However, I found the lib didn't support collation feature well. Hence, below query with ignoreCase won't work:

    private final Collation collation = Collation.of("en").strength(Collation.ComparisonLevel.secondary());
public Credential findOneByUserNameIgnoreCase(String userName) {

        return mongoTemplate
            .findOne(new Query(Criteria.where(CredentialRepository.USER_NAME_FIELD).is(userName)).collation(collation),
                Credential.class);
    }

Any ideas?
Thank in advance

@gregecho
Copy link
Author

@bwaldvogel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant