Examples of MongoDatabaseProvider


Examples of org.eclipselabs.emongo.MongoDatabaseProvider

    // 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));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.