/** * Get the {@link MongoDbFactory} object associated with the only MongoDB service bound to the app. * * This is equivalent to the <cloud:mongo-db-factory/> element. * * @return mongo db factory * @throws CloudException if there are either 0 or more than 1 mongodb services. */ public MongoDbFactory mongoDbFactory() { return mongoDbFactory((MongoDbFactoryConfig)null); }
/** * Get the {@link MongoDbFactory} object for the specified MongoDB service. * * This is equivalent to the <cloud:mongo-db-factory service-id="serviceId"> element. * * @param serviceId the name of the service * @return mongo db factory * @throws CloudException if the specified service doesn't exist */ public MongoDbFactory mongoDbFactory(String serviceId) { return mongoDbFactory(serviceId, null); }