@Immutable public interface MongoClient extends Closeable
Instance of this class server as factories for MongoDatabase instances.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the client, which will close all underlying cached resources, including, for example,
sockets and background monitoring threads.
|
MongoDatabase |
getDatabase(String name)
Gets the database with the given name.
|
com.mongodb.async.client.MongoClientSettings |
getSettings()
Gets the settings that this client uses to connect to server.
|
rx.Observable<String> |
listDatabaseNames()
Get a list of the database names
|
ListDatabasesObservable<org.bson.Document> |
listDatabases()
Gets the list of databases
|
<TResult> ListDatabasesObservable<TResult> |
listDatabases(Class<TResult> clazz)
Gets the list of databases
|
MongoDatabase getDatabase(String name)
name - the name of the databasevoid close()
close in interface AutoCloseableclose in interface Closeablecom.mongodb.async.client.MongoClientSettings getSettings()
Note: MongoClientSettings is immutable.
rx.Observable<String> listDatabaseNames()
ListDatabasesObservable<org.bson.Document> listDatabases()
<TResult> ListDatabasesObservable<TResult> listDatabases(Class<TResult> clazz)
TResult - the type of the class to use instead of Document.clazz - the class to cast the database documents to