Package org.nuxeo.runtime.mongodb
Interface MongoDBConnectionService
-
- All Known Implementing Classes:
MongoDBComponent
public interface MongoDBConnectionServiceService used to get a database connection to MongoDB.- Since:
- 9.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description com.mongodb.client.MongoClientgetClient(String id)Gets the MongoDB client for the given id.MongoDBConnectionConfiggetConfig(String id)Gets the MongoDB configuration for the given id.com.mongodb.client.MongoDatabasegetDatabase(String id)StringgetDatabaseName(String id)Gets the MongoDB database name for the given id.Iterable<com.mongodb.client.MongoDatabase>getDatabases()Deprecated.since 11.1, unused
-
-
-
Method Detail
-
getClient
com.mongodb.client.MongoClient getClient(String id)
Gets the MongoDB client for the given id.- Parameters:
id- the connection id- Returns:
- the client configured by
MongoDBConnectionConfigfor the input id, or the default one if it doesn't exist - Since:
- 11.1
-
getConfig
MongoDBConnectionConfig getConfig(String id)
Gets the MongoDB configuration for the given id.- Since:
- 11.1
-
getDatabaseName
String getDatabaseName(String id)
Gets the MongoDB database name for the given id.- Parameters:
id- the connection id- Returns:
- the database name configured by
MongoDBConnectionConfigfor the input id, or the default one if it doesn't exist - Since:
- 11.1
-
getDatabase
com.mongodb.client.MongoDatabase getDatabase(String id)
- Parameters:
id- the connection id- Returns:
- the database configured by
MongoDBConnectionConfigfor the input id, or the default one if it doesn't exist
-
getDatabases
@Deprecated Iterable<com.mongodb.client.MongoDatabase> getDatabases()
Deprecated.since 11.1, unused- Returns:
- all configured databases
-
-