Skip to content

Commit 2b450b5

Browse files
chayimsazzad16
andauthored
Updating the getting started to highlight the redis-stack-server docker (#507)
Co-authored-by: M Sazzadul Hoque <[email protected]>
1 parent eb14537 commit 2b450b5

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

.github/wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ utf
5555
validator
5656
validators
5757
virtualenv
58+
http

README.md

+30-16
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ span
3030
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3131

3232
- [💡 Why Redis OM?](#-why-redis-om)
33+
- [💻 Installation](#-installation)
34+
- [🏁 Getting started](#-getting-started)
3335
- [📇 Modeling Your Data](#-modeling-your-data)
3436
- [✓ Validating Data With Your Model](#-validating-data-with-your-model)
3537
- [🔎 Rich Queries and Embedded Models](#-rich-queries-and-embedded-models)
3638
- [Querying](#querying)
3739
- [Embedded Models](#embedded-models)
3840
- [Calling Other Redis Commands](#calling-other-redis-commands)
39-
- [💻 Installation](#-installation)
4041
- [📚 Documentation](#-documentation)
4142
- [⛏️ Troubleshooting](#️-troubleshooting)
4243
- [✨ So How Do You Get RediSearch and RedisJSON?](#-so-how-do-you-get-redisearch-and-redisjson)
@@ -57,6 +58,31 @@ This **preview** release contains the following features:
5758
* Declarative secondary-index generation
5859
* Fluent APIs for querying Redis
5960

61+
## 💻 Installation
62+
63+
Installation is simple with `pip`, Poetry, or Pipenv.
64+
65+
```sh
66+
# With pip
67+
$ pip install redis-om
68+
69+
# Or, using Poetry
70+
$ poetry add redis-om
71+
```
72+
73+
## 🏁 Getting started
74+
75+
### Starting Redis
76+
77+
Before writing any code you'll need a Redis instance with the appropriate Redis modules! The quickest way to get this is with Docker:
78+
79+
```sh
80+
docker run -p 6379:6379 -p 8001:8001 redis/redis-stack
81+
```
82+
83+
This launches the [redis-stack](https://redis.io/docs/stack/) an extension of Redis that adds all manner of modern data structures to Redis. You'll also notice that if you open up http://localhost:8001 you'll have access to the redis-insight GUI, a GUI you can use to visualize and work with your data in Redis.
84+
85+
6086
## 📇 Modeling Your Data
6187

6288
Redis OM contains powerful declarative models that give you data validation, serialization, and persistence to Redis.
@@ -204,7 +230,7 @@ from redis_om import (
204230
Migrator
205231
)
206232

207-
233+
208234
class Customer(HashModel):
209235
first_name: str
210236
last_name: str = Field(index=True)
@@ -228,7 +254,7 @@ Customer.find(Customer.last_name == "Brookins").all()
228254
# Find all customers that do NOT have the last name "Brookins"
229255
Customer.find(Customer.last_name != "Brookins").all()
230256

231-
# Find all customers whose last name is "Brookins" OR whose age is
257+
# Find all customers whose last name is "Brookins" OR whose age is
232258
# 100 AND whose last name is "Smith"
233259
Customer.find((Customer.last_name == "Brookins") | (
234260
Customer.age == 100
@@ -281,7 +307,7 @@ class Customer(JsonModel):
281307
address: Address
282308

283309

284-
# With these two models and a Redis deployment with the RedisJSON
310+
# With these two models and a Redis deployment with the RedisJSON
285311
# module installed, we can run queries like the following.
286312

287313
# Before running queries, we need to run migrations to set up the
@@ -326,18 +352,6 @@ redis_conn = get_redis_connection()
326352
redis_conn.set("hello", "world")
327353
```
328354

329-
## 💻 Installation
330-
331-
Installation is simple with `pip`, Poetry, or Pipenv.
332-
333-
```sh
334-
# With pip
335-
$ pip install redis-om
336-
337-
# Or, using Poetry
338-
$ poetry add redis-om
339-
```
340-
341355
## 📚 Documentation
342356

343357
The Redis OM documentation is available [here](docs/index.md).

0 commit comments

Comments
 (0)