Skip to content

Commit b7322a1

Browse files
committed
doc: added new section "selecting redis databases".
1 parent c2cd2c7 commit b7322a1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.markdown

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ngx_redis2 - Nginx upstream module for the Redis 2.0 protocol
88
Table of Contents
99
=================
1010

11+
* [Name](#name)
1112
* [Status](#status)
1213
* [Version](#version)
1314
* [Synopsis](#synopsis)
@@ -24,6 +25,7 @@ Table of Contents
2425
* [redis2_buffer_size](#redis2_buffer_size)
2526
* [redis2_next_upstream](#redis2_next_upstream)
2627
* [Connection Pool](#connection-pool)
28+
* [Selecting Redis Databases](#selecting-redis-databases)
2729
* [Lua Interoperability](#lua-interoperability)
2830
* [Pipelined Redis Requests by Lua](#pipelined-redis-requests-by-lua)
2931
* [Redis Publish/Subscribe Support](#redis-publishsubscribe-support)
@@ -375,6 +377,20 @@ A sample config snippet looks like this
375377

376378
[Back to TOC](#table-of-contents)
377379

380+
Selecting Redis Databases
381+
=========================
382+
383+
Redis provides the [select](http://redis.io/commands/SELECT) command to switch Redis databaess. This command is no different from other normal commands
384+
like [get](http://redis.io/commands/GET) or [set](http://redis.io/commands/SET). So you can use them in [redis2_query](#redis2_query) directives, for
385+
example,
386+
387+
```nginx
388+
redis2_query select 8;
389+
redis2_query get foo;
390+
```
391+
392+
[Back to TOC](#table-of-contents)
393+
378394
Lua Interoperability
379395
====================
380396

@@ -741,3 +757,5 @@ SEE ALSO
741757
* The [ngx_openresty bundle](http://openresty.org).
742758
* The [lua-resty-redis](https://github.com/openresty/lua-resty-redis) library based on the [lua-nginx-module](http://github.com/openresty/lua-nginx-module) cosocket API.
743759

760+
[Back to TOC](#table-of-contents)
761+

0 commit comments

Comments
 (0)