LISTDB

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Synopsis

LISTDB is used to list all the yedis database(s) available for use. All databases other than the default database (“0”) need to be created using the CREATEDB command before use.

A client can issue the LISTDB command through the redis-cli.

Return Value

Returns an array of string values, with the yedis database names.

Examples

You can do this as shown below.

  1. $ LISTDB
  1. 1) "0"
  1. $ CREATEDB "second"
  1. "OK"
  1. $ LISTDB
  1. 1) "0"
  2. 2) "second"
  1. $ CREATEDB "3.0"
  1. "OK"
  1. $ LISTDB
  1. 1) "0"
  2. 2) "3.0"
  3. 3) "second"
  1. $ DELETEDB "3.0"
  1. "OK"
  1. $ LISTDB
  1. 1) "0"
  2. 2) "second"

See Also

createdblistdbdeletedbflushdbflushallselect