当前位置: 首页>>代码示例>>Java>>正文


Java MongoClient类代码示例

本文整理汇总了Java中com.mongodb.reactivestreams.client.MongoClient的典型用法代码示例。如果您正苦于以下问题:Java MongoClient类的具体用法?Java MongoClient怎么用?Java MongoClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MongoClient类属于com.mongodb.reactivestreams.client包,在下文中一共展示了MongoClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
public MongoClient getClient() {
   return client;
}
 
开发者ID:JaiHirsch,项目名称:flink-mingo-tail,代码行数:4,代码来源:MongoClientWrapper.java

示例2: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Bean
MongoClient mongoClient() {
	return MongoClients.create();
}
 
开发者ID:SpringOnePlatform2016,项目名称:whats-new-in-spring-data,代码行数:5,代码来源:ApplicationConfiguration.java

示例3: mongoDatabase

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Bean
MongoDatabase mongoDatabase(MongoClient mongoClient) {
	return mongoClient.getDatabase(database);
}
 
开发者ID:SpringOnePlatform2016,项目名称:whats-new-in-spring-data,代码行数:5,代码来源:ApplicationConfiguration.java

示例4: reactiveMongoDbFactory

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Bean
ReactiveMongoDbFactory reactiveMongoDbFactory(MongoClient mongoClient) {
	return new ReactiveMongoDbFactory(mongoClient, database);
}
 
开发者ID:SpringOnePlatform2016,项目名称:whats-new-in-spring-data,代码行数:5,代码来源:ApplicationConfiguration.java

示例5: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
    return MongoClients.create();
}
 
开发者ID:sdeleuze,项目名称:spring-reactive-playground,代码行数:5,代码来源:MongoConfiguration.java

示例6: getMongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
public static synchronized MongoClient getMongoClient() {
    if (mongoClient == null) {
        mongoClient = MongoClients.create(getConnectionString());
        Runtime.getRuntime().addShutdownHook(new ShutdownHook());
    }
    return mongoClient;
}
 
开发者ID:mongodb,项目名称:mongo-java-driver-reactivestreams,代码行数:8,代码来源:Fixture.java

示例7: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
    return MongoClients.create(String.format("mongodb://%s:%d", mongoProperties.getHost(), mongoProperties.getPort()));
}
 
开发者ID:aliaksei-lithium,项目名称:spring5demo,代码行数:5,代码来源:MongoConfiguration.java

示例8: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
	return MongoClients.create();
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:5,代码来源:MongoConfig.java

示例9: reactiveMongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient reactiveMongoClient() {
    return MongoClients.create(mongoUri);
}
 
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:5,代码来源:MongoConfig.java

示例10: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
public MongoClient mongoClient() {
	return MongoClients.create(String.format("mongodb://localhost:%d", mongoProperties.getPort()));
}
 
开发者ID:callistaenterprise,项目名称:spring-react-one,代码行数:4,代码来源:ApplicationConfiguration.java

示例11: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
@Bean
@DependsOn("embeddedMongoServer")
public MongoClient mongoClient() {
	return MongoClients.create(String.format("mongodb://localhost:%d", mongoProperties.getPort()));
}
 
开发者ID:Just-Fun,项目名称:spring-data-examples,代码行数:7,代码来源:ApplicationConfiguration.java

示例12: reactiveMongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient reactiveMongoClient() {
	return MongoClients.create("mongodb://localhost/"+getDatabaseName());
}
 
开发者ID:Angular2Guy,项目名称:AngularAndSpring,代码行数:5,代码来源:MongoDbConfiguration.java

示例13: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
  return MongoClients.create(url);
}
 
开发者ID:atsticks,项目名称:docker-workshop,代码行数:5,代码来源:MongoConfiguration.java

示例14: mongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
    // this assumes your MongoDB is running on the default port, i.e. 27017
    return MongoClients.create();
}
 
开发者ID:orlandovald,项目名称:webflux-twitter-demo,代码行数:6,代码来源:WebfluxTwitterDemoApplication.java

示例15: reactiveMongoClient

import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient reactiveMongoClient() {
  return MongoClients.create(url);
}
 
开发者ID:amoAHCP,项目名称:openshift-workshop,代码行数:5,代码来源:MongoConfiguration.java


注:本文中的com.mongodb.reactivestreams.client.MongoClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。