Example usage for com.mongodb.async.client MongoClients create

List of usage examples for com.mongodb.async.client MongoClients create

Introduction

In this page you can find the example usage for com.mongodb.async.client MongoClients create.

Prototype

public static MongoClient create(final com.mongodb.MongoClientSettings settings,
        @Nullable final MongoDriverInformation mongoDriverInformation) 

Source Link

Document

Creates a new client with the given client settings.

Usage

From source file:io.opentracing.contrib.mongo.TracingAsyncMongoClient.java

License:Apache License

public TracingAsyncMongoClient(final Tracer tracer, final MongoClientSettings settings,
        final MongoDriverInformation mongoDriverInformation) {
    TracingCommandListener tracingCommandListener = new TracingCommandListener(tracer);
    this.mongoClient = MongoClients.create(
            MongoClientSettings.builder(settings).addCommandListener(tracingCommandListener).build(),
            mongoDriverInformation);//from w w w  .j  ava  2  s  .  c o m
}