Rate This Document
Findability
Accuracy
Completeness
Readability

Commands delete and deleterange

Prerequisites

Before running following commands, create a target database or ensure that a database has been created. For details about how to create a database, see 2.

Procedure

  1. Go to the /home directory.
    cd /home
  2. Run the scan command to view the existing data in the database.
    ldb  --db=/home/rocksdb/rkdb scan

  3. Use ldb to run the delete command to delete the values of a specified key.
    ldb  --db=/home/rocksdb/rkdb delete k5

  4. Run the get command to query the values of k5.
    ldb  --db=/home/rocksdb/rkdb get k5

  5. Use ldb to run the deleterange command to delete the values of keys in a specified range.
    ldb  --db=/home/rocksdb/rkdb deleterange k2 k4

  6. View the result after deletion.
    ldb  --db=/home/rocksdb/rkdb scan