void createIndex(final MongoCollection collection, final MappedClass mc, final Index index, final boolean background) { Index normalized = IndexBuilder.normalize(index); BsonDocument keys = calculateKeys(mc, normalized); com.mongodb.client.model.IndexOptions indexOptions = convert(normalized.options(), background); calculateWeights(normalized, indexOptions); collection.createIndex(keys, indexOptions); } }