public interface Mongo extends Closeable
Modifier and Type | Method and Description |
---|---|
Mongo |
asSerializedMongo()
Returns a Mongo instance that shares connections with this Mongo instance
but serializes all of its requests on a single connection.
|
MongoDbConfiguration |
getConfig()
Returns the configuration being used by the logical MongoDB connection.
|
MongoDatabase |
getDatabase(String name)
Returns the MongoDatabase with the specified name.
|
List<String> |
listDatabases()
Returns a future for the list of database names.
|
Mongo asSerializedMongo()
While the returned Mongo instance is thread safe it is intended to be used by a single logical thread to ensure requests issued to the MongoDB server are guaranteed to be processed in the same order they are requested.
Creation of the serial instance is lightweight with minimal object allocation and no server interaction.
MongoDbConfiguration getConfig()
MongoDatabase getDatabase(String name)
name
- The name of the existing database.MongoDatabase
.Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.