Search in sources :

Example 11 with IndexOptions

use of com.mongodb.client.model.IndexOptions in project mongo-java-driver by mongodb.

the class AddIndexAcceptanceTest method shouldCreateABackgroundIndex.

@Test
@Ignore("Ingore until SERVER-16274 if resolved")
public void shouldCreateABackgroundIndex() {
    collection.createIndex(new Document("theField", 1), new IndexOptions().background(true));
    Boolean background = collection.listIndexes().into(new ArrayList<Document>()).get(1).getBoolean("background");
    assertThat("Should be a background index", background, is(true));
}
Also used : IndexOptions(com.mongodb.client.model.IndexOptions) Document(org.bson.Document) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

IndexOptions (com.mongodb.client.model.IndexOptions)11 Document (org.bson.Document)11 Test (org.junit.Test)4 MongoDatabase (com.mongodb.client.MongoDatabase)3 TableNotFoundException (com.facebook.presto.spi.TableNotFoundException)2 ArrayList (java.util.ArrayList)2 OBJECT_ID (com.facebook.presto.mongodb.ObjectIdType.OBJECT_ID)1 ColumnHandle (com.facebook.presto.spi.ColumnHandle)1 SchemaNotFoundException (com.facebook.presto.spi.SchemaNotFoundException)1 SchemaTableName (com.facebook.presto.spi.SchemaTableName)1 Domain (com.facebook.presto.spi.predicate.Domain)1 Range (com.facebook.presto.spi.predicate.Range)1 TupleDomain (com.facebook.presto.spi.predicate.TupleDomain)1 BIGINT (com.facebook.presto.spi.type.BigintType.BIGINT)1 BOOLEAN (com.facebook.presto.spi.type.BooleanType.BOOLEAN)1 DOUBLE (com.facebook.presto.spi.type.DoubleType.DOUBLE)1 NamedTypeSignature (com.facebook.presto.spi.type.NamedTypeSignature)1 StandardTypes (com.facebook.presto.spi.type.StandardTypes)1 TIMESTAMP (com.facebook.presto.spi.type.TimestampType.TIMESTAMP)1 Type (com.facebook.presto.spi.type.Type)1