Mono<String> createIndex(IndexDefinitionHolder indexDefinition) { JustOnceLogger.logWarnIndexCreationConfigurationChange(this.getClass().getName()); return operationsProvider.indexOps(indexDefinition.getCollection()).ensureIndex(indexDefinition) // .onErrorResume(ReactiveMongoPersistentEntityIndexCreator::isDataIntegrityViolation, e -> translateException(e, indexDefinition)); }
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)); }
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); }); }