All Products
Search
Document Center

Modify a key

Last Updated: Jun 08, 2019

This section describes how to modify a key.

Notes

You must have access permissions to DMS and be logged on to the DMS console.

Procedure

  1. Select an ApsaraDB for Redis instance and then click Log on to Database.

  2. After logging on to the instance, select the database that contains the target key from the drop-down list, as shown in the following figure:

    redis-edit-key-1

  3. To search for a key, enter the key name or keyword in the key name in the search box, and the press Enter or click the magnifier icon.

  4. After the search is complete, select the target key in the list and then double-click the row to open the editing window.

    Note

    The value editing window varies depending on the type of the value.

  • Value type 1: String

    The following figure shows the editing window for String type values:

    redis-create-key-string

    1. Enter the value in the Value text box.

    2. Click Submit. A dialog box appears displaying the command that is used to create the key.

    3. Click OK to submit the changes.

  • Value type 2: List

    The following figure shows the editing window for List type values:

    redis-create-key-list

    1. Add, modify, or delete the values in the value list.

      Notes

      • To add multiple values, click Add to Top to add the values to the top of the list or click Add to Bottom to add the values to the bottom of the list.

      • To modify an existing value, double-click the value.

      • To delete an existing value, click the target row, and then click Delete.

      • Information about the number of data entries per page and the number of pages is displayed at the bottom of each page. You can click the button of each page to go to the corresponding page.

    2. Click Submit. A dialog box appears displaying the command that is used to create the key.

    3. Click OK to submit the changes.

  • Value type 3: Hash

    The following figure shows the editing window for Hash type values:

    redis-create-key-hash

    1. Modify the values in the value list. To add multiple data entries, click Add. To modify a data entry, double-click the target row. To delete a data entry, select the target row, and then click Delete.

      Note:

      A valid data entry must contain a key and a value. You cannot use the same key in different data entries. Different data entries can have the same value. You can enter the keyword of the key in the search box to search for the target data entry.

    2. Click Submit. A dialog box appears displaying the command that is used to create the key.

    3. Click OK to submit the changes.

  • Value type 4: Set

    The following figure shows the editing window for Set type values:

    redis-create-key-set

    1. Modify the values in the value list. To add multiple data entries, click Add. To modify a data entry, double-click the target row. To delete a data entry, select the target row, and then click Delete.

      Note:

      You cannot use the same value in different data entries. You can enter the key or keyword of key in the search box to search for the target data entry.

    2. Click Submit. A dialog box appears displaying the command that is used to create the key.

    3. Click OK to submit the changes.

  • Value type 5: ZSet(Sorted Set)

    The following figure shows the editing window for ZSet type values:

    redis-create-key-zset

    1. Modify the values in the value list. To add multiple data entries, click Add. To modify a data entry, double-click the target row. To delete a data entry, select the target row, and then click Delete.

      Note:

      A valid data entry must contain a value and a score. You cannot use the same value in different data entries. Different data entries can have the same score. Valid scores include integers and decimals. You can use the search function to search for the target data entry and click Switch Search to search by keyword or by decimal.

    2. Click Submit. A dialog box appears displaying the command that is used to create the key.

    3. Click OK to submit the changes.