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
for [JSON]({{< relref "/develop/data-types/json" >}}) data and
21
-
run queries against the index.
20
+
for [JSON]({{< relref "/develop/data-types/json" >}}) documents and
21
+
run queries against the index. It then goes on to show the slight differences
22
+
in the equivalent code for [hash]({{< relref "/develop/data-types/hashes" >}})
23
+
documents.
22
24
23
-
Make sure that you have Redis Community Edition and `NRedisStack` installed.
25
+
## Initialize
24
26
25
-
Start by importing dependencies:
27
+
Make sure that you have [Redis Community Edition]({{< relref "/operate/rc" >}})
28
+
or another Redis server available. Also install the
29
+
[`NRedisStack`]({{< relref "/develop/clients/dotnet" >}}) client library if you
30
+
haven't already done so.
31
+
32
+
Add the following dependencies:
26
33
27
34
{{< clients-example cs_home_json import >}}
28
35
{{< /clients-example >}}
29
36
30
-
Connect to the database:
31
-
32
-
{{< clients-example cs_home_json connect >}}
33
-
{{< /clients-example >}}
37
+
## Create data
34
38
35
39
Create some test data to add to the database:
36
40
37
41
{{< clients-example cs_home_json create_data >}}
38
42
{{< /clients-example >}}
39
43
44
+
## Add the index
45
+
46
+
Connect to your Redis database. The code below shows the most
47
+
basic connection but see
48
+
[Connect to the server]({{< relref "/develop/clients/dotnet/connect" >}})
49
+
to learn more about the available connection options.
50
+
51
+
{{< clients-example cs_home_json connect >}}
52
+
{{< /clients-example >}}
53
+
40
54
Create an index. In this example, only JSON documents with the key prefix `user:` are indexed. For more information, see [Query syntax]({{< relref "/develop/interact/search-and-query/query/" >}}).
41
55
42
56
{{< clients-example cs_home_json make_index >}}
43
57
{{< /clients-example >}}
44
58
59
+
## Add the data
60
+
45
61
Add the three sets of user data to the database as
0 commit comments