We are developing an Application on Spring 5 Reactive Stack. For persistance we use MongoDb with ReactiveMongoRepository
(ReactiveCrudRepository
) from Spring Data.
Currently for fetching data we are using a Query like
@Query("{ 'ownerId': ?0, filePath: {$regex: ?1}, tags: { $all : ?2}}")
Flux<Media> findAllByOwnerIdAndFilePathRegexAndTagsContainingAll(String ownerId, String pathRegex, List<Tag> tags);
Now we want to get the data by incasesensitive tags. For this I've created a index in the db with a collation like { locale: 'en', strength: 2 }
as described here.
Now i want to get my data from db with using the index. The MonogoDB way would be db.media.find( { filePath: "/example/" } ).collation( { locale: 'en', strength: 2 } )
.
Does someone know a smart way to use Collations from ReactiveMongoRepository?