Close the client, which will close all underlying cached resources, including, for example, sockets and background monitoring threads.
Close the client, which will close all underlying cached resources, including, for example, sockets and background monitoring threads.
Gets the current cluster description.
Gets the current cluster description.
This method will not block, meaning that it may return a { @link ClusterDescription} whose { @code clusterType} is unknown and whose { @link com.mongodb.connection.ServerDescription}s are all in the connecting state. If the application requires notifications after the driver has connected to a member of the cluster, it should register a { @link ClusterListener} via the { @link ClusterSettings} in { @link com.mongodb.MongoClientSettings}.
the current cluster description
4.1
com.mongodb.MongoClientSettings.Builder#applyToClusterSettings(com.mongodb.Block)
ClusterSettings.Builder#addClusterListener(ClusterListener)
Gets the database with the given name.
Gets the database with the given name.
the name of the database
the database
Get a list of the database names
Get a list of the database names
the client session with which to associate this operation
an iterable containing all the names of all the databases
2.2
Requires MongoDB 3.6 or greater
Get a list of the database names
Get a list of the database names
an iterable containing all the names of all the databases
Gets the list of databases
Gets the list of databases
the type of the class to use instead of Document
.
the client session with which to associate this operation
the fluent list databases interface
2.2
Requires MongoDB 3.6 or greater
Gets the list of databases
Gets the list of databases
the type of the class to use instead of Document
.
the fluent list databases interface
Creates a client session.
Creates a client session.
Note: A ClientSession instance can not be used concurrently in multiple asynchronous operations.
the options for the client session
2.2
Requires MongoDB 3.6 or greater
Creates a client session.
Creates a client session.
Note: A ClientSession instance can not be used concurrently in multiple asynchronous operations.
2.4
Requires MongoDB 3.6 or greater
Creates a change stream for this collection.
Creates a change stream for this collection.
the target document type of the observable.
the client session with which to associate this operation
the aggregation pipeline to apply to the change stream
the change stream observable
2.4
Requires MongoDB 4.0 or greater
Creates a change stream for this collection.
Creates a change stream for this collection.
the target document type of the observable.
the client session with which to associate this operation
the change stream observable
2.4
Requires MongoDB 4.0 or greater
Creates a change stream for this collection.
Creates a change stream for this collection.
the target document type of the observable.
the aggregation pipeline to apply to the change stream
the change stream observable
2.4
Requires MongoDB 4.0 or greater
Creates a change stream for this collection.
Creates a change stream for this collection.
the target document type of the observable.
the change stream observable
2.4
Requires MongoDB 4.0 or greater
(Since version ) see corresponding Javadoc for more information.
A client-side representation of a MongoDB cluster. Instances can represent either a standalone MongoDB instance, a replica set, or a sharded cluster. Instance of this class are responsible for maintaining an up-to-date state of the cluster, and possibly cache resources related to this, including background threads for monitoring, and connection pools.
Instance of this class server as factories for MongoDatabase instances.
the underlying java MongoClient
1.0