public void ensureIndex(DBObject keys, String name, boolean unique) throws MongoException {
        dbCollection.ensureIndex(keys, name, unique);
    }
public void ensureIndex ( DBObject keys , String name , boolean unique ) throws MongoException { dbCollection . ensureIndex ( keys , name , unique ) ; }
Ensures an index on this collection (that is, the index will be created if it does not exist).

@param keys   fields to use for index
@param name   an identifier for the index. If null or empty, the default name will be used.
@param unique if the index should be unique
@throws MongoException If an error occurred