- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我们正在 Spring 5 Reactive Stack 上开发一个应用程序。为了持久化,我们将 MongoDb 与来自 Spring Data 的 ReactiveMongoRepository
(ReactiveCrudRepository
) 结合使用。
目前我们正在使用类似查询的方式来获取数据
@Query("{ 'ownerId': ?0, filePath: {$regex: ?1}, tags: { $all : ?2}}")
Flux<Media> findAllByOwnerIdAndFilePathRegexAndTagsContainingAll(String ownerId, String pathRegex, List<Tag> tags);
现在我们要通过区分大小写的标签获取数据。为此,我在数据库中创建了一个索引,其排序规则如 { locale: 'en', strength: 2 }
所述 here .
现在我想使用索引从数据库中获取我的数据。 MonogoDB 的方式是 db.media.find( { filePath: "/example/"} ).collation( { locale: 'en', strength: 2 } )
。
有人知道使用 ReactiveMongoRepository 中的排序规则的聪明方法吗?
最佳答案
对于当前版本的 Spring Data,您需要使用 MongoOperations
提供定义 Collation
的 Query
。
请引用Reference Documentation有关详细信息。
请确保也查看/评论 DATAMONGO-1854它建议将 collation 添加到 @Query
。
关于spring - 从 Spring Data ReactiveMongoRepository 使用 Collation 的聪明方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53787378/
我认为这个问题可能与我的Mongo Document Koltin Data类有关,但是对于我们的业务案例,我们需要允许用户添加任何JSON字段来描述其RF数据集。 扩展BasicDBObject是我
我知道分页有点违背 react 性原则,但由于要求我必须以某种方式让它工作。我正在使用 Spring Data 2.1.6,但我无法升级所以 ReactiveQuerydslSpecification
我有一个扩展了 ReactiveMongoRepository 的 MovieRepository。我想以 react 方式保存单个 POJO。但是 ReactiveMongoRepository 没
我有一个扩展了 ReactiveMongoRepository 的 MovieRepository。我想以 react 方式保存单个 POJO。但是 ReactiveMongoRepository 没
我有一个服务将数据流式传输到第二个服务,该服务接收对象流并将它们保存到我的 MongoDB。 在我从流服务获得的 Flux 对象上的 subscribe 函数中,我使用了 ReactiveMongoR
当使用 Spring Data MongoDB 的响应式(Reactive)编程模型时,可以执行如下事务: Mono result = template.inTransaction()
我们正在 Spring 5 Reactive Stack 上开发一个应用程序。为了持久化,我们将 MongoDb 与来自 Spring Data 的 ReactiveMongoRepository (
我是一名优秀的程序员,十分优秀!