Package org.mongodb.morphia

Examples of org.mongodb.morphia.Datastore.ensureIndexes()


                mongo,
                application.configuration().getString("mongodb.db"),
                application.configuration().getString("mongodb.username"),
                application.configuration().getString("mongodb.password").toCharArray());

        datastore.ensureIndexes();

        Logger.info("Connected to MongoDB [" + mongo.debugString() + "] database [" + datastore.getDB().getName() + "]");
        return datastore;
    }
View Full Code Here


        // given
        getMorphia().map(IndexOnValue.class, NoIndexes.class);
        Datastore ds = getDs();

        // when
        ds.ensureIndexes();
        ds.save(new IndexOnValue());
        ds.save(new NoIndexes());

        // then
        List<DBObject> indexes = getDb().getCollection("NoIndexes").getIndexInfo();
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.