For Single Field indexes in mongodb we can set the IndexOptions as below
collection.createIndex(
Indexes.ascending(actualIndexFieldName), new IndexOptions().background(true));
But not sure how to set the IndexOptions for a compound index in java.
Thanks in Advance