diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ComputedProperty.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ComputedProperty.java index 630a3dd93fa07..67a7811ccded2 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ComputedProperty.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ComputedProperty.java @@ -17,7 +17,7 @@ * ) * ); * containerProperties.setComputedProperties(computedProperties); - * database.createContainer(containerProperties); + * database.createContainer(containerProperties).subscribe(); * * * @@ -30,8 +30,9 @@ * new ComputedProperty("upperName", "SELECT VALUE UPPER(c.name) FROM c") * ) * ); + * containerProperties.setComputedProperties(computedProperties); * container = database.getContainer(containerName); - * container.replace(containerProperties); + * container.replace(containerProperties).subscribe(); * * */ diff --git a/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ComputedPropertiesCodeSnippet.java b/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ComputedPropertiesCodeSnippet.java index e98f1fd6eef8d..16fa59c64965f 100644 --- a/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ComputedPropertiesCodeSnippet.java +++ b/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ComputedPropertiesCodeSnippet.java @@ -36,7 +36,7 @@ public void createContainerWithComputedProperties() { ) ); containerProperties.setComputedProperties(computedProperties); - database.createContainer(containerProperties); + database.createContainer(containerProperties).subscribe(); // END: com.azure.cosmos.computedProperty.createContainer } @@ -48,8 +48,9 @@ public void replaceContainerWithComputedProperties() { new ComputedProperty("upperName", "SELECT VALUE UPPER(c.name) FROM c") ) ); + containerProperties.setComputedProperties(computedProperties); container = database.getContainer(containerName); - container.replace(containerProperties); + container.replace(containerProperties).subscribe(); // END: com.azure.cosmos.computedProperty.replaceContainer } @@ -57,12 +58,12 @@ public void replaceContainerWithExistingComputedProperties() { // BEGIN: com.azure.cosmos.computedProperty.replaceContainer.existingProperties container = database.getContainer(containerName); - CosmosContainerProperties modifiedProperites = container.read().block().getProperties(); - Collection modifiedComputedProperites = modifiedProperites.getComputedProperties(); - modifiedComputedProperites.add(new ComputedProperty("upperName", "SELECT VALUE UPPER(c.firstName) FROM c")); - modifiedProperites.setComputedProperties(modifiedComputedProperites); + CosmosContainerProperties modifiedProperties = container.read().block().getProperties(); + Collection modifiedComputedProperties = modifiedProperties.getComputedProperties(); + modifiedComputedProperties.add(new ComputedProperty("upperName", "SELECT VALUE UPPER(c.firstName) FROM c")); + modifiedProperties.setComputedProperties(modifiedComputedProperties); - container.replace(modifiedProperites); + container.replace(modifiedProperties).subscribe(); // END: com.azure.cosmos.computedProperty.replaceContainer.existingProperties }