text: /*
   * Copyright (c) Microsoft Corporation.
   * Licensed under the MIT License.
   *
   * Code generated by Microsoft (R) AutoRest Code Generator.
   * Changes may cause incorrect behavior and will be lost if the code is regenerated.
   */
  
  // Copyright (c) Microsoft Corporation.
  // Licensed under the MIT License.
  const { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  /**
   * This sample demonstrates how to Updates a database
   *
   * @summary Updates a database
   * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json
   */
  async function redisEnterpriseDatabasesUpdate() {
    const subscriptionId = "subid";
    const resourceGroupName = "rg1";
    const clusterName = "cache1";
    const databaseName = "default";
    const parameters = {
      clientProtocol: "Encrypted",
      evictionPolicy: "AllKeysLRU",
      persistence: { rdbEnabled: true, rdbFrequency: "12h" },
    };
    const credential = new DefaultAzureCredential();
    const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
    const result = await client.databases.beginUpdateAndWait(
      resourceGroupName,
      clusterName,
      databaseName,
      parameters
    );
    console.log(result);
  }
  
  redisEnterpriseDatabasesUpdate().catch(console.error);
  