本文整理汇总了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;
}
示例2: mongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Bean
MongoClient mongoClient() {
return MongoClients.create();
}
示例3: mongoDatabase
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Bean
MongoDatabase mongoDatabase(MongoClient mongoClient) {
return mongoClient.getDatabase(database);
}
示例4: reactiveMongoDbFactory
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Bean
ReactiveMongoDbFactory reactiveMongoDbFactory(MongoClient mongoClient) {
return new ReactiveMongoDbFactory(mongoClient, database);
}
示例5: mongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
return MongoClients.create();
}
示例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;
}
示例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()));
}
示例8: mongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
return MongoClients.create();
}
示例9: reactiveMongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient reactiveMongoClient() {
return MongoClients.create(mongoUri);
}
示例10: mongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
public MongoClient mongoClient() {
return MongoClients.create(String.format("mongodb://localhost:%d", mongoProperties.getPort()));
}
示例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()));
}
示例12: reactiveMongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient reactiveMongoClient() {
return MongoClients.create("mongodb://localhost/"+getDatabaseName());
}
示例13: mongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient mongoClient() {
return MongoClients.create(url);
}
示例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();
}
示例15: reactiveMongoClient
import com.mongodb.reactivestreams.client.MongoClient; //导入依赖的package包/类
@Override
public MongoClient reactiveMongoClient() {
return MongoClients.create(url);
}