草庐IT

ReactiveMongoRepository

全部标签

spring - 为什么 Spring ReactiveMongoRepository 没有 Mono 的保存方法?

我有一个扩展了ReactiveMongoRepository的MovieRepository。我想以react方式保存单个POJO。但是ReactiveMongoRepository没有为Mono或Publisher提供保存方法。我必须在ReactiveMongoRepository中使用block()方法或使用saveAll方法。publicMonocreate(ServerRequestrequest){MonomovieMono=request.bodyToMono(Movie.class);returnmovieRepository.save(movieMono.block()

spring - 从 Spring Data ReactiveMongoRepository 使用 Collat​​ion 的聪明方法

我们正在Spring5ReactiveStack上开发一个应用程序。为了持久化,我们将MongoDb与来自SpringData的ReactiveMongoRepository(ReactiveCrudRepository)结合使用。目前我们正在使用类似查询的方式来获取数据@Query("{'ownerId':?0,filePath:{$regex:?1},tags:{$all:?2}}")FluxfindAllByOwnerIdAndFilePathRegexAndTagsContainingAll(StringownerId,StringpathRegex,Listtags);现在我