Fix mangled CLI examples
This commit is contained in:
parent
4111330124
commit
9606a57852
1 changed files with 29 additions and 16 deletions
|
@ -41,6 +41,12 @@ Instead of installing Redis manually or with a package manager, you can run Redi
|
||||||
|
|
||||||
**TIP:** If you plan on using Docker, we recommend the [redismod](https://hub.docker.com/r/redislabs/redismod) image because it includes the RediSearch and RedisJSON modules.
|
**TIP:** If you plan on using Docker, we recommend the [redismod](https://hub.docker.com/r/redislabs/redismod) image because it includes the RediSearch and RedisJSON modules.
|
||||||
|
|
||||||
|
You start Redis with Docker with the `docker run` command, like this:
|
||||||
|
|
||||||
|
docker run -d -p 6379:6379 redislabs/redismod
|
||||||
|
|
||||||
|
**NOTE**: We'll talk more about this command (specifically, the arguments chosen) when we discuss running Redis later in this guide.
|
||||||
|
|
||||||
## Recommended: RediSearch and RedisJSON
|
## Recommended: RediSearch and RedisJSON
|
||||||
|
|
||||||
Redis OM relies on the [RediSearch][redisearch-url] and [RedisJSON][redis-json-url] Redis modules to support [rich queries](querying.md) and [embedded models](embedded_models.md).
|
Redis OM relies on the [RediSearch][redisearch-url] and [RedisJSON][redis-json-url] Redis modules to support [rich queries](querying.md) and [embedded models](embedded_models.md).
|
||||||
|
@ -52,6 +58,7 @@ The easiest way to run these Redis modules during local development is to use th
|
||||||
You can quickly start Redis with the redismod Docker image by running the following command:
|
You can quickly start Redis with the redismod Docker image by running the following command:
|
||||||
|
|
||||||
docker run -d -p 6379:6379 redislabs/redismod
|
docker run -d -p 6379:6379 redislabs/redismod
|
||||||
|
|
||||||
**TIP:** The `-d` option runs Redis in the background.
|
**TIP:** The `-d` option runs Redis in the background.
|
||||||
|
|
||||||
For other installation methods, follow the "Quick Start" guides on both modules' home pages for alternative installation methods.
|
For other installation methods, follow the "Quick Start" guides on both modules' home pages for alternative installation methods.
|
||||||
|
@ -67,6 +74,7 @@ The command you use to start Redis will depend on how you installed it.
|
||||||
If you installed Redis using `apt`, start it with the `systemctl` command:
|
If you installed Redis using `apt`, start it with the `systemctl` command:
|
||||||
|
|
||||||
sudo systemctl restart redis.service
|
sudo systemctl restart redis.service
|
||||||
|
|
||||||
Otherwise, you can start the server manually:
|
Otherwise, you can start the server manually:
|
||||||
|
|
||||||
redis-server start
|
redis-server start
|
||||||
|
@ -79,11 +87,11 @@ brew services start redis
|
||||||
|
|
||||||
The command to start Redis with Docker depends on the image you've chosen to use.
|
The command to start Redis with Docker depends on the image you've chosen to use.
|
||||||
|
|
||||||
#### Docker with the redismod image (recommended)
|
#### Docker with the `redismod` image (recommended)
|
||||||
|
|
||||||
docker run -d -p 6379:6379 redislabs/redismod
|
docker run -d -p 6379:6379 redislabs/redismod
|
||||||
|
|
||||||
### Docker iwth the redis image
|
### Docker with the `redis` image
|
||||||
|
|
||||||
docker run -d -p 6379:6379 redis
|
docker run -d -p 6379:6379 redis
|
||||||
|
|
||||||
|
@ -92,9 +100,11 @@ docker run -d -p 6379:6379 redis
|
||||||
You can install Redis OM with `pip` by running the following command:
|
You can install Redis OM with `pip` by running the following command:
|
||||||
|
|
||||||
pip install redis-om
|
pip install redis-om
|
||||||
|
|
||||||
Or, if you're using Poetry, you can install Redis OM with the following command:
|
Or, if you're using Poetry, you can install Redis OM with the following command:
|
||||||
|
|
||||||
poetry install redis-om
|
poetry install redis-om
|
||||||
|
|
||||||
With Pipenv, the command is:
|
With Pipenv, the command is:
|
||||||
|
|
||||||
pipenv install redis-om
|
pipenv install redis-om
|
||||||
|
@ -110,15 +120,18 @@ However, if you configured Redis to run on a different port, or if you're using
|
||||||
The `REDIS_URL` environment variable follows the redis-py URL format:
|
The `REDIS_URL` environment variable follows the redis-py URL format:
|
||||||
|
|
||||||
redis://[[username]:[password]]@localhost:6379/[database number]
|
redis://[[username]:[password]]@localhost:6379/[database number]
|
||||||
The default connection is eqivalent to the following `REDIS_URL` environment variable:
|
|
||||||
|
The default connection is equivalent to the following `REDIS_URL` environment variable:
|
||||||
|
|
||||||
redis://@localhost:6379
|
redis://@localhost:6379
|
||||||
|
|
||||||
**TIP:** Redis databases are numbered, and the default is 0. You can leave off the database number to use the default database.
|
**TIP:** Redis databases are numbered, and the default is 0. You can leave off the database number to use the default database.
|
||||||
|
|
||||||
Other supported prefixes include "rediss" for SSL connections and "unix" for Unix domain sockets:
|
Other supported prefixes include "rediss" for SSL connections and "unix" for Unix domain sockets:
|
||||||
|
|
||||||
rediss://[[username]:[password]]@localhost:6379/0
|
rediss://[[username]:[password]]@localhost:6379/0
|
||||||
unix://[[username]:[password]]@/path/to/socket.sock?db=0
|
unix://[[username]:[password]]@/path/to/socket.sock?db=0
|
||||||
|
|
||||||
For more details about how to connect to Redis with Redis OM, see the [connections documentation](connections.md).
|
For more details about how to connect to Redis with Redis OM, see the [connections documentation](connections.md).
|
||||||
|
|
||||||
### Redis Cluster Support
|
### Redis Cluster Support
|
||||||
|
|
Loading…
Reference in a new issue