Package com.mongodb

Examples of com.mongodb.DBCollection.ensureIndex()


                    if (NucleusLogger.DATASTORE_SCHEMA.isDebugEnabled())
                    {
                        NucleusLogger.DATASTORE_SCHEMA.debug(LOCALISER.msg("MongoDB.SchemaCreate.Class.Index",
                            pkName, MongoDBUtils.getCollectionName(cmd), query));
                    }
                    collection.ensureIndex(query, pkName, true);
                }
            }

            AbstractMemberMetaData[] mmds = cmd.getManagedMembers();
            if (mmds != null && mmds.length > 0)
View Full Code Here


                        if (NucleusLogger.DATASTORE_SCHEMA.isDebugEnabled())
                        {
                            NucleusLogger.DATASTORE_SCHEMA.debug(LOCALISER.msg("MongoDB.SchemaCreate.Class.Index",
                                idxmd.getName(), MongoDBUtils.getCollectionName(cmd), query));
                        }
                        collection.ensureIndex(query, idxmd.getName(), idxmd.isUnique());
                    }
                    UniqueMetaData unimd = mmds[i].getUniqueMetaData();
                    if (unimd != null)
                    {
                        BasicDBObject query = new BasicDBObject();
View Full Code Here

                        if (NucleusLogger.DATASTORE_SCHEMA.isDebugEnabled())
                        {
                            NucleusLogger.DATASTORE_SCHEMA.debug(LOCALISER.msg("MongoDB.SchemaCreate.Class.Index",
                                unimd.getName(), MongoDBUtils.getCollectionName(cmd), query));
                        }
                        collection.ensureIndex(query, unimd.getName(), true);
                    }
                }
            }
        }
    }
View Full Code Here

    // Get the collection to add indexes to.
    DBCollection collection =
      MongoDao.getInstance().getDb().getCollection(DB_NAME);

    // Ensure that there is an index on the ID.
    collection
      .ensureIndex(
        new BasicDBObject(Schema.JSON_KEY_ID, 1),
        DB_NAME + "_" + Schema.JSON_KEY_ID + "_index",
        false);
    // Ensure that there is an index on the version.
View Full Code Here

      .ensureIndex(
        new BasicDBObject(Schema.JSON_KEY_ID, 1),
        DB_NAME + "_" + Schema.JSON_KEY_ID + "_index",
        false);
    // Ensure that there is an index on the version.
    collection
      .ensureIndex(
        new BasicDBObject(Schema.JSON_KEY_VERSION, 1),
        DB_NAME + "_" + Schema.JSON_KEY_VERSION + "_index",
        false);
   
View Full Code Here

        new BasicDBObject(Schema.JSON_KEY_VERSION, 1),
        DB_NAME + "_" + Schema.JSON_KEY_VERSION + "_index",
        false);
   
    // Ensure that there is a compound, unique key on the ID and version.
    collection
      .ensureIndex(
        (new BasicDBObject(Schema.JSON_KEY_ID, 1))
          .append(Schema.JSON_KEY_VERSION, 1),
        DB_NAME +
          "_" +
View Full Code Here

    // Get the collection to add indexes to.
    DBCollection collection =
      MongoDao.getInstance().getDb().getCollection(DB_NAME);
   
    // Ensure that there is an index on the code.
    collection
      .ensureIndex(
        new BasicDBObject(AuthorizationCode.JSON_KEY_CODE, 1),
        DB_NAME + "_" + AuthorizationCode.JSON_KEY_CODE + "_unique",
        true);
  }
View Full Code Here

    // Get the collection to add indexes to.
    DBCollection collection =
      MongoDao.getInstance().getDb().getCollection(DB_NAME);
   
    // Ensure that there is an index on the token.
    collection
      .ensureIndex(
        new BasicDBObject(Data.JSON_KEY_OWNER, 1),
        DB_NAME + "_" + Data.JSON_KEY_OWNER + "_index",
        false);
   
View Full Code Here

        new BasicDBObject(Data.JSON_KEY_OWNER, 1),
        DB_NAME + "_" + Data.JSON_KEY_OWNER + "_index",
        false);
   
    // Ensure that there is an index on the schema's ID.
    collection
      .ensureIndex(
        new BasicDBObject(Schema.JSON_KEY_ID, 1),
        DB_NAME + "_" + Schema.JSON_KEY_ID + "_index",
        false);
    // Ensure that there is an index on the schema's version.
View Full Code Here

      .ensureIndex(
        new BasicDBObject(Schema.JSON_KEY_ID, 1),
        DB_NAME + "_" + Schema.JSON_KEY_ID + "_index",
        false);
    // Ensure that there is an index on the schema's version.
    collection
      .ensureIndex(
        new BasicDBObject(Schema.JSON_KEY_VERSION, 1),
        DB_NAME + "_" + Schema.JSON_KEY_VERSION + "_index",
        false);
   
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.