@Override public void dropAllIndexes() { reactiveIndexOperations.dropAllIndexes().block(); }
@Override public void dropIndex(String name) { reactiveIndexOperations.dropIndex(name).block(); }
@Override public String ensureIndex(IndexDefinition indexDefinition) { return reactiveIndexOperations.ensureIndex(indexDefinition).block(); }
@Override public List<IndexInfo> getIndexInfo() { return reactiveIndexOperations.getIndexInfo().collectList().block(); } };
private Mono<IndexInfo> fetchIndexInformation(IndexDefinitionHolder indexDefinition) { Object indexNameToLookUp = indexDefinition.getIndexOptions().get("name"); Flux<IndexInfo> existingIndexes = operationsProvider.indexOps(indexDefinition.getCollection()).getIndexInfo(); return existingIndexes // .filter(indexInfo -> ObjectUtils.nullSafeEquals(indexNameToLookUp, indexInfo.getName())) // .next() // .doOnError(e -> { LOGGER.debug( String.format("Failed to load index information for collection '%s'.", indexDefinition.getCollection()), e); }); }
Mono<String> createIndex(IndexDefinitionHolder indexDefinition) { JustOnceLogger.logWarnIndexCreationConfigurationChange(this.getClass().getName()); return operationsProvider.indexOps(indexDefinition.getCollection()).ensureIndex(indexDefinition) // .onErrorResume(ReactiveMongoPersistentEntityIndexCreator::isDataIntegrityViolation, e -> translateException(e, indexDefinition)); }
@Override public List<IndexInfo> getIndexInfo() { return reactiveIndexOperations.getIndexInfo().collectList().block(); } };
@Override public void dropIndex(String name) { reactiveIndexOperations.dropIndex(name).block(); }
@Override public void dropAllIndexes() { reactiveIndexOperations.dropAllIndexes().block(); }
@Override public String ensureIndex(IndexDefinition indexDefinition) { return reactiveIndexOperations.ensureIndex(indexDefinition).block(); }
private Mono<IndexInfo> fetchIndexInformation(IndexDefinitionHolder indexDefinition) { Object indexNameToLookUp = indexDefinition.getIndexOptions().get("name"); Flux<IndexInfo> existingIndexes = operationsProvider.indexOps(indexDefinition.getCollection()).getIndexInfo(); return existingIndexes // .filter(indexInfo -> ObjectUtils.nullSafeEquals(indexNameToLookUp, indexInfo.getName())) // .next() // .doOnError(e -> { LOGGER.debug( String.format("Failed to load index information for collection '%s'.", indexDefinition.getCollection()), e); }); }
Mono<String> createIndex(IndexDefinitionHolder indexDefinition) { return operationsProvider.indexOps(indexDefinition.getCollection()).ensureIndex(indexDefinition) // .onErrorResume(ReactiveMongoPersistentEntityIndexCreator::isDataIntegrityViolation, e -> translateException(e, indexDefinition)); }