SELECT

Synopsis

SELECT is used to change the yedis database that the client is communicating with. By default, all client connections start off communicating with the default database ("0"). To start using a database, other than the default database ("0"), it needs to be pre-created using the CREATEDB command before use.

Return value

Returns a status string if successful. Returns an error if the database is not already created.

Examples

$ SET k1 v1
"OK"
$ GET k1
"v1"
$ LISTDB
1) "0"
$ CREATEDB "second"
"OK"
$ SELECT "second"
"OK"
$ SET k1 v2
"OK"
$ GET k1
"v2"
$ SELECT 0
"OK"
$ GET k1
"v1"

See also

createdb listdb deletedb flushdb flushall select