// collection segment # 1.
if (uri.segmentCount() != 3)
throw new IOException("The URI is not of the form 'mongodb:/database/collection/{id}");
MongoDatabaseProvider mongoDatabaseProvider = mongoDatabaseProviders.get(uri.trimQuery().trimSegments(2).toString());
if (mongoDatabaseProvider == null)
throw new IOException("Database is not available");
DB database = mongoDatabaseProvider.getDB();
if (database == null)
throw new IOException("Database is not available");
DBCollection dbCollection = database.getCollection(uri.segment(1));