You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started.md
+9-16Lines changed: 9 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ You can also use the official Redis Docker image, which is hosted on [Docker Hub
47
47
48
48
## Recommended: RediSearch and RedisJSON
49
49
50
-
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).
50
+
Redis OM relies on the [RediSearch][redisearch-url] and [RedisJSON][redis-json-url] Redis modules to support rich queries and embedded models.
51
51
52
52
You don't need these Redis modules to use Redis OM's data modeling, validation, and persistence features, but we recommend them to get the most out of Redis OM.
53
53
@@ -129,16 +129,6 @@ Other supported prefixes include "rediss" for SSL connections and "unix" for Uni
For more details about how to connect to Redis with Redis OM, see the [connections documentation](connections.md).
133
-
134
-
### Redis Cluster Support
135
-
136
-
Redis OM supports connecting to Redis Cluster, but this preview release does not support doing so with the `REDIS_OM_URL` environment variable. However, you can connect by manually creating a connection object.
137
-
138
-
See the [connections documentation](connections.md) for examples of connecting to Redis Cluster.
139
-
140
-
Support for connecting to Redis Cluster via `REDIS_OM_URL` will be added in a future release.
141
-
142
132
## Defining a Model
143
133
144
134
In this tutorial, we'll create a `Customer` model that validates and saves data. Let's start with a basic definition of the model. We'll add features as we go along.
@@ -163,7 +153,7 @@ There are a few details to note:
163
153
1. Our `Customer` model extends the `HashModel` class. This means that it will be saved to Redis as a hash. The other model class that Redis OM provides is `JsonModel`, which we'll discuss later.
164
154
2. We've specified the model's fields using Python type annotations.
165
155
166
-
Let's dig into these two details a bit more.
156
+
Let's dig into the `HashModel` class and type annotations a bit more.
167
157
168
158
### The HashModel Class
169
159
@@ -669,6 +659,7 @@ from pydantic import EmailStr
669
659
670
660
from redis_om import (
671
661
Field,
662
+
get_redis_connection,
672
663
HashModel,
673
664
Migrator
674
665
)
@@ -689,7 +680,8 @@ class Customer(HashModel):
689
680
# Before running queries, we need to run migrations to set up the
690
681
# indexes that Redis OM will use. You can also use the `migrate`
691
682
# CLI tool for this!
692
-
Migrator().run()
683
+
redis = get_redis_connection()
684
+
Migrator(redis).run()
693
685
694
686
# Find all customers with the last name "Brookins"
Many more types of queries are possible. learn more about querying with Redis OM, see the [documentation on querying](docs/querying.md).
708
-
709
699
## Next Steps
710
700
711
-
Now that you know the basics of working with Redis OM, continue on for all the nitty-gritty details about [models and fields](models_and_fields.md).
701
+
Now that you know the basics of working with Redis OM, start playing around with it in your project!
702
+
703
+
If you're a FastAPI user, check out [how to integrate Redis OM with FastAPI](https://github.com/redis/redis-om-python/blob/main/docs/fastapi_integration.md).
0 commit comments