本文整理汇总了Java中org.springframework.data.mongodb.core.ReactiveMongoOperations类的典型用法代码示例。如果您正苦于以下问题:Java ReactiveMongoOperations类的具体用法?Java ReactiveMongoOperations怎么用?Java ReactiveMongoOperations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReactiveMongoOperations类属于org.springframework.data.mongodb.core包,在下文中一共展示了ReactiveMongoOperations类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onStart
import org.springframework.data.mongodb.core.ReactiveMongoOperations; //导入依赖的package包/类
/**
* Application runner to initialize a capped collection for {@link Event}s and insert a new {@link Event} every two
* seconds.
*
* @param operations
* @param reactiveOperations
* @return
*/
@Bean
ApplicationRunner onStart(MongoOperations operations, ReactiveMongoOperations reactiveOperations) {
return args -> {
CollectionOptions options = CollectionOptions.empty() //
.capped() //
.size(2048) //
.maxDocuments(1000);
operations.dropCollection(Event.class);
operations.createCollection(Event.class, options);
Flux.interval(Duration.ofSeconds(2)) //
.map(counter -> new Event(LocalDateTime.now())) //
.flatMap(reactiveOperations::save) //
.log() //
.subscribe();
};
}
开发者ID:olivergierke,项目名称:spring-five-functional-reactive,代码行数:29,代码来源:WebfluxDemo.java
示例2: reactiveMongoOperationsSessionRepository
import org.springframework.data.mongodb.core.ReactiveMongoOperations; //导入依赖的package包/类
@Bean
public ReactiveMongoOperationsSessionRepository reactiveMongoOperationsSessionRepository(ReactiveMongoOperations operations) {
ReactiveMongoOperationsSessionRepository repository = new ReactiveMongoOperationsSessionRepository(operations);
if (this.mongoSessionConverter != null) {
repository.setMongoSessionConverter(this.mongoSessionConverter);
}
if (this.maxInactiveIntervalInSeconds != null) {
repository.setMaxInactiveIntervalInSeconds(this.maxInactiveIntervalInSeconds);
}
if (this.collectionName != null) {
repository.setCollectionName(this.collectionName);
}
if (this.mongoOperations != null) {
repository.setBlockingMongoOperations(this.mongoOperations);
}
return repository;
}
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:24,代码来源:ReactiveMongoWebSessionConfiguration.java
示例3: missingReactorSessionRepositoryBreaksAppContext
import org.springframework.data.mongodb.core.ReactiveMongoOperations; //导入依赖的package包/类
@Test
public void missingReactorSessionRepositoryBreaksAppContext() {
this.context = new AnnotationConfigApplicationContext();
this.context.register(BadConfig.class);
assertThatExceptionOfType(UnsatisfiedDependencyException.class)
.isThrownBy(this.context::refresh)
.withMessageContaining("Error creating bean with name 'reactiveMongoOperationsSessionRepository'")
.withMessageContaining("No qualifying bean of type '" + ReactiveMongoOperations.class.getCanonicalName());
}
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:12,代码来源:ReactiveMongoWebSessionConfigurationTest.java
示例4: reactiveMongoRepositoryFactory
import org.springframework.data.mongodb.core.ReactiveMongoOperations; //导入依赖的package包/类
@Bean
ReactiveMongoRepositoryFactory reactiveMongoRepositoryFactory(ReactiveMongoOperations reactiveMongoOperations) {
ReactiveMongoRepositoryFactory factory = new ReactiveMongoRepositoryFactory(reactiveMongoOperations);
factory.setRepositoryBaseClass(SimpleReactiveMongoRepository.class);
factory.setBeanClassLoader(classLoader);
factory.setBeanFactory(beanFactory);
factory.setEvaluationContextProvider(DefaultEvaluationContextProvider.INSTANCE);
return factory;
}
开发者ID:SpringOnePlatform2016,项目名称:whats-new-in-spring-data,代码行数:12,代码来源:ApplicationConfiguration.java
示例5: ReactiveMongoOperationsSessionRepository
import org.springframework.data.mongodb.core.ReactiveMongoOperations; //导入依赖的package包/类
public ReactiveMongoOperationsSessionRepository(ReactiveMongoOperations mongoOperations) {
this.mongoOperations = mongoOperations;
}
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:4,代码来源:ReactiveMongoOperationsSessionRepository.java
示例6: operations
import org.springframework.data.mongodb.core.ReactiveMongoOperations; //导入依赖的package包/类
@Bean
ReactiveMongoOperations operations() {
return mock(ReactiveMongoOperations.class);
}
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:5,代码来源:ReactiveMongoWebSessionConfigurationTest.java
示例7: reactiveMongoOperations
import org.springframework.data.mongodb.core.ReactiveMongoOperations; //导入依赖的package包/类
@Bean
ReactiveMongoOperations reactiveMongoOperations() {
return mock(ReactiveMongoOperations.class);
}
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:5,代码来源:ReactiveMongoWebSessionConfigurationTest.java
注:本文中的org.springframework.data.mongodb.core.ReactiveMongoOperations类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论