Examples of ensureIndex()


Examples of com.mongodb.DBCollection.ensureIndex()

    // Build the index for sorting.
    String sortingFields =
      Data.JSON_KEY_METADATA +
        ColumnList.COLUMN_SEPARATOR +
        MetaData.JSON_KEY_TIMESTAMP;
    collection.ensureIndex(
      new BasicDBObject(sortingFields, 1),
      DB_NAME + "_" + sortingFields + "_index",
      false);
  }
 
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

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

Examples of com.mongodb.DBCollection.ensureIndex()

        new BasicDBObject(User.JSON_KEY_USERNAME, 1),
        DB_NAME + "_" + User.JSON_KEY_USERNAME + "_unique",
        true);
   
    // Ensure that there is an index on the username.
    collection
      .ensureIndex(
        new BasicDBObject(User.JSON_KEY_REGISTRATION_KEY, 1),
        DB_NAME + "_" + User.JSON_KEY_REGISTRATION_KEY,
        false);
  }
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

    // Get the collection to add indexes to.
    DBCollection collection =
      MongoDao.getInstance().getDb().getCollection(DB_NAME);
   
    // Ensure that there is an unique index on the code.
    collection
      .ensureIndex(
        new BasicDBObject(
          AuthorizationCodeResponse.JSON_KEY_AUTHORIZATION_CODE,
          1),
        DB_NAME +
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

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

    // Ensure that there is an index on the access token.
    collection
      .ensureIndex(
        new BasicDBObject(AuthorizationToken.JSON_KEY_ACCESS_TOKEN, 1),
        DB_NAME +
          "_" +
          AuthorizationToken.JSON_KEY_ACCESS_TOKEN +
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

          "_" +
          AuthorizationToken.JSON_KEY_ACCESS_TOKEN +
          "_unique",
        true);
    // Ensure that there is an index on the refresh token.
    collection
      .ensureIndex(
        new BasicDBObject(
          AuthorizationToken.JSON_KEY_REFRESH_TOKEN,
          1),
        DB_NAME +
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

    // 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(ThirdParty.JSON_KEY_ID, 1),
        DB_NAME + "_" + ThirdParty.JSON_KEY_ID + "_unique",
        true);
  }
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

    // 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(AuthenticationToken.JSON_KEY_TOKEN, 1),
        DB_NAME + "_" + AuthenticationToken.JSON_KEY_TOKEN + "_unique",
        true);
    // Ensure that there is an index on the expiration time.
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

      .ensureIndex(
        new BasicDBObject(AuthenticationToken.JSON_KEY_TOKEN, 1),
        DB_NAME + "_" + AuthenticationToken.JSON_KEY_TOKEN + "_unique",
        true);
    // Ensure that there is an index on the expiration time.
    collection
      .ensureIndex(
        new BasicDBObject(AuthenticationToken.JSON_KEY_EXPIRES, 1),
        DB_NAME +
          "_" +
          AuthenticationToken.JSON_KEY_EXPIRES +
View Full Code Here

Examples of com.mongodb.DBCollection.ensureIndex()

        DBCollection commitCollection = mongoConnection.getCommitCollection();
        DBObject index = new BasicDBObject();
        index.put(CommitMongo.KEY_REVISION_ID, Long.valueOf(1));
        DBObject options = new BasicDBObject();
        options.put("unique", Boolean.TRUE);
        commitCollection.ensureIndex(index, options);
        CommitMongo commit = new CommitMongo();
        commit.setAffectedPaths(Arrays.asList(new String[] { "/" }));
        commit.setBaseRevId(0L);
        commit.setDiff("+/ : {}");
        commit.setMessage("This is an autogenerated initial commit");
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.