SELECT
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
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
You can do this as shown below.
$ 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
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .