/** * calls {@link DBCollection#ensureIndex(com.mongodb.DBObject, java.lang.String, boolean)} with unique=false * * @param keys fields to use for index * @param name an identifier for the index * @throws MongoException If an error occurred */ public void ensureIndex(DBObject keys, String name) throws MongoException { ensureIndex(keys, name, false); }
/** * calls {@link DBCollection#ensureIndex(com.mongodb.DBObject, java.lang.String, boolean)} with unique=false * * @param keys fields to use for index * @param name an identifier for the index * @throws MongoException If an error occurred */ public void ensureIndex(DBObject keys, String name) throws MongoException { ensureIndex(keys, name, false); }
/** * Creates an ascending index on a field with default options, if one does not already exist. * * @param name name of field to index on */ public final void ensureIndex(final String name) { ensureIndex(new BasicDBObject(name, 1)); }
/** * Creates an ascending index on a field with default options, if one does not already exist. * * @param name name of field to index on */ public final void ensureIndex(final String name) { ensureIndex(new BasicDBObject(name, 1)); }