public class HelperMongo extends Object implements Mongo
EMPTY| Constructor and Description |
|---|
HelperMongo(MongoDatabaseCredentials credentials) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
com.mongodb.MongoClient |
getClient()
Gets the client instance backing the datasource
|
com.mongodb.client.MongoDatabase |
getDatabase()
Gets the main database in use by the instance.
|
com.mongodb.client.MongoDatabase |
getDatabase(String name)
Gets a specific database instance
|
org.mongodb.morphia.Morphia |
getMorphia()
Gets the Morphia instance for this datasource
|
org.mongodb.morphia.Datastore |
getMorphiaDatastore()
Gets the main Morphia datastore in use by the instance
|
org.mongodb.morphia.Datastore |
getMorphiaDatastore(String name)
Gets a specific Morphia datastore instance
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbindWith, closeAndReportException, closeSilently, isClosedpublic HelperMongo(@Nonnull MongoDatabaseCredentials credentials)
@Nonnull public com.mongodb.MongoClient getClient()
Mongo@Nonnull public com.mongodb.client.MongoDatabase getDatabase()
MongogetDatabase in interface Mongopublic com.mongodb.client.MongoDatabase getDatabase(String name)
MongogetDatabase in interface Mongoname - the name of the databasepublic void close()
close in interface AutoCloseableclose in interface Terminablepublic org.mongodb.morphia.Morphia getMorphia()
MongogetMorphia in interface Mongopublic org.mongodb.morphia.Datastore getMorphiaDatastore()
MongogetMorphiaDatastore in interface Mongopublic org.mongodb.morphia.Datastore getMorphiaDatastore(String name)
MongogetMorphiaDatastore in interface Mongoname - the name of the databaseCopyright © 2018. All rights reserved.