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
The RedisJSON module provides JSON support for Redis. RedisJSON lets you store, update, and retrieve JSON values in a Redis database, similar to any other Redis data type. RedisJSON also works seamlessly with [RediSearch](https://redis.io/docs/stack/search/) to let you [index and query JSON documents](https://redis.io/docs/stack/search/indexing_json).
12
+
Redis JSON provides JavaScript Object Notation (JSON) support for Redis. It lets you store, update, and retrieve JSON values in a Redis database, similar to any other Redis data type. Redis JSON also works seamlessly with [Search and Query](https://redis.io/docs/stack/search/) to let you [index and query JSON documents](https://redis.io/docs/stack/search/indexing_json).
13
13
14
14
## Primary features
15
15
@@ -18,22 +18,22 @@ The RedisJSON module provides JSON support for Redis. RedisJSON lets you store,
18
18
* Documents stored as binary data in a tree structure, allowing fast access to sub-elements
19
19
* Typed atomic operations for all JSON value types
20
20
21
-
## Use RedisJSON
21
+
## Use Redis JSON
22
22
23
-
To learn how to use RedisJSON, it's best to start with the Redis CLI. The following examples assume that you're connected to a Redis server with RedisJSON enabled.
23
+
To learn how to use JSON, it's best to start with the Redis CLI. The following examples assume that you're connected to a Redis server with JSON enabled.
24
24
25
25
### `redis-cli` examples
26
26
27
27
First, start [`redis-cli`](http://redis.io/topics/rediscli) in interactive mode.
28
28
29
-
The first RedisJSON command to try is `JSON.SET`, which sets a Redis key with a JSON value. `JSON.SET` accepts all JSON value types. This example creates a JSON string:
29
+
The first JSON command to try is `JSON.SET`, which sets a Redis key with a JSON value. `JSON.SET` accepts all JSON value types. This example creates a JSON string:
30
30
31
31
```sh
32
-
127.0.0.1:6379> JSON.SET animal $ '"dog"'
32
+
> JSON.SET animal $ '"dog"'
33
33
"OK"
34
-
127.0.0.1:6379> JSON.GET animal $
34
+
> JSON.GET animal $
35
35
"[\"dog\"]"
36
-
127.0.0.1:6379> JSON.TYPE animal $
36
+
> JSON.TYPE animal $
37
37
1) "string"
38
38
```
39
39
@@ -42,77 +42,77 @@ Note how the commands include the dollar sign character `$`. This is the [path](
42
42
Here are a few more string operations. `JSON.STRLEN` tells you the length of the string, and you can append another string to it with `JSON.STRAPPEND`.
1. Clone the [RedisJSON repository](https://github.com/RedisJSON/RedisJSON) (make sure you include the `--recursive` option to properly clone submodules):
181
+
1. Clone the [repository](https://github.com/RedisJSON/RedisJSON) (make sure you include the `--recursive` option to properly clone submodules):
In the above lines replace `/path/to/module/` with the actual path to the module.
243
243
244
-
Alternatively, you can download and run RedisJSON from a precompiled binary:
244
+
Alternatively, you can download and run JSON from a precompiled binary:
245
245
246
-
1. Download a precompiled version of RedisJSON from the [Redis download center](https://redis.com/download-center/modules/).
246
+
1. Download a precompiled version of JSON from the [Redis download center](https://redis.com/download-center/modules/).
247
247
248
248
#### Command-line option
249
249
@@ -257,7 +257,7 @@ In the above lines replace `/path/to/module/` with the actual path to the module
257
257
258
258
#### `MODULE LOAD` command
259
259
260
-
You can also use the `MODULE LOAD` command to load RedisJSON. Note that `MODULE LOAD` is a **dangerous command** and may be blocked/deprecated in the future due to security considerations.
260
+
You can also use the `MODULE LOAD` command to load JSON. Note that `MODULE LOAD` is a **dangerous command** and may be blocked/deprecated in the future due to security considerations.
261
261
262
262
After the module has been loaded successfully, the Redis log should have lines similar to:
Copy file name to clipboardExpand all lines: docs/docs/developer.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,12 @@ description: >
6
6
Notes on debugging, testing and documentation
7
7
---
8
8
9
-
# Developing RedisJSON
9
+
# Developing Redis JSON
10
10
11
-
Developing RedisJSON involves setting up the development environment (which can be either Linux-based or macOS-based), building RedisJSON, running tests and benchmarks, and debugging both the RedisJSON module and its tests.
11
+
Developing Redis JSON involves setting up the development environment (which can be either Linux-based or macOS-based), building JSON, running tests and benchmarks, and debugging both the JSON module and its tests.
12
12
13
13
## Cloning the git repository
14
-
To clone the RedisJSON module and its submodules, run:
You can replace `debian:bullseye` with your OS of choice. If you use the same OS as your host machine, you can run the RedisJSON binary on your host after it is built.
41
+
You can replace `debian:bullseye` with your OS of choice. If you use the same OS as your host machine, you can run the JSON binary on your host after it is built.
42
42
43
43
## Installing prerequisites
44
44
45
-
To build and test RedisJSON one needs to install several packages, depending on the underlying OS. Currently, we support the Ubuntu/Debian, CentOS, Fedora, and macOS.
45
+
To build and test JSON one needs to install several packages, depending on the underlying OS. Currently, we support the Ubuntu/Debian, CentOS, Fedora, and macOS.
46
46
47
47
Enter `RedisJSON` directory and run:
48
48
@@ -124,13 +124,13 @@ make sanbox # create container for CLang Sanitizer tests
124
124
```
125
125
126
126
## Building from source
127
-
Run ```make build``` to build RedisJSON.
127
+
Run ```make build``` to build JSON.
128
128
129
129
Notes:
130
130
131
131
* Binary files are placed under `target/release/`, according to platform and build variant.
132
132
133
-
*RedisJSON uses [Cargo](https://github.com/rust-lang/cargo) as its build system. ```make build``` will invoke both Cargo and the subsequent `make` command that's required to complete the build.
133
+
*JSON uses [Cargo](https://github.com/rust-lang/cargo) as its build system. ```make build``` will invoke both Cargo and the subsequent `make` command that's required to complete the build.
134
134
135
135
Use ```make clean``` to remove built artifacts. ```make clean ALL=1``` will remove the entire bin subdirectory.
136
136
@@ -154,7 +154,7 @@ $ REDIS_PORT=6379 make test
154
154
```
155
155
156
156
## Debugging
157
-
To include debugging information, you need to set the `DEBUG` environment variable before you compile RedisJSON. For example, run `export DEBUG=1`.
157
+
To include debugging information, you need to set the `DEBUG` environment variable before you compile JSON. For example, run `export DEBUG=1`.
158
158
159
159
You can add breakpoints to Python tests in single-test mode. To set a breakpoint, call the ```BB()``` function inside a test.
Copy file name to clipboardExpand all lines: docs/docs/indexing_JSON.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
title: Index/Search JSON documents
3
3
linkTitle: Index/Search
4
4
weight: 2
5
-
description: Combine RedisJSON and RediSearch to index and search JSON documents
5
+
description: Combine Redis JSON and Search and Query to index and search JSON documents
6
6
---
7
7
8
-
In addition to storing JSON documents, you can also index them using the [RediSearch](/docs/stack/search)module. This enables full-text search capabilities and document retrieval based on their content.
8
+
In addition to storing JSON documents, you can also index them using the [Search and Query](/docs/stack/search)feature. This enables full-text search capabilities and document retrieval based on their content.
9
9
10
-
To use these features, you must install two modules: RedisJSON and RediSearch. [Redis Stack](/docs/stack) automatically includes both modules.
10
+
To use these features, you must install two modules: JSON and Search and Query. [Redis Stack](/docs/stack) automatically includes both modules.
11
11
12
-
See the [tutorial](/docs/stack/search/indexing_json) to learn how to use RediSearch with RedisJSON.
12
+
See the [tutorial](/docs/stack/search/indexing_json) to learn how to use Search and Query with JSON.
Copy file name to clipboardExpand all lines: docs/docs/path.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,18 @@ weight: 3
5
5
description: Access specific elements within a JSON document
6
6
---
7
7
8
-
Paths help you access specific elements within a JSON document. Since no standard for JSON path syntax exists, RedisJSON implements its own. RedisJSON's syntax is based on common best practices and intentionally resembles [JSONPath](http://goessner.net/articles/JsonPath/).
8
+
Paths help you access specific elements within a JSON document. Since no standard for JSON path syntax exists, Redis JSON implements its own. JSON's syntax is based on common best practices and intentionally resembles [JSONPath](http://goessner.net/articles/JsonPath/).
9
9
10
-
RedisJSON supports two query syntaxes: [JSONPath syntax](#jsonpath-syntax) and the [legacy path syntax](#legacy-path-syntax) from the first version of RedisJSON.
10
+
JSON supports two query syntaxes: [JSONPath syntax](#jsonpath-syntax) and the [legacy path syntax](#legacy-path-syntax) from the first version of JSON.
11
11
12
-
RedisJSON knows which syntax to use depending on the first character of the path query. If the query starts with the character `$`, it uses JSONPath syntax. Otherwise, it defaults to the legacy path syntax.
12
+
JSON knows which syntax to use depending on the first character of the path query. If the query starts with the character `$`, it uses JSONPath syntax. Otherwise, it defaults to the legacy path syntax.
13
13
14
14
The returned value is a JSON string with a top-level array of JSON serialized strings.
15
15
And if multi-paths are used, the return value is a JSON string with a top-level object with values that are arrays of serialized JSON values.
16
16
17
17
## JSONPath support
18
18
19
-
RedisJSON v2.0 introduced [JSONPath](http://goessner.net/articles/JsonPath/) support. It follows the syntax described by Goessner in his [article](http://goessner.net/articles/JsonPath/).
19
+
JSON v2.0 introduced [JSONPath](http://goessner.net/articles/JsonPath/) support. It follows the syntax described by Goessner in his [article](http://goessner.net/articles/JsonPath/).
20
20
21
21
A JSONPath query can resolve to several locations in a JSON document. In this case, the JSON commands apply the operation to every possible location. This is a major improvement over [legacy path](#legacy-path-syntax) queries, which only operate on the first path.
22
22
@@ -248,11 +248,11 @@ JSONPath queries also work with other JSON commands that accept a path as an arg
248
248
249
249
## Legacy path syntax
250
250
251
-
RedisJSON v1 had the following path implementation. RedisJSON v2 still supports this legacy path in addition to JSONPath.
251
+
JSON v1 had the following path implementation. JSON v2 still supports this legacy path in addition to JSONPath.
252
252
253
-
Paths always begin at the root of a RedisJSON value. The root is denoted by a period character (`.`). For paths that reference the root's children, it is optional to prefix the path with the root.
253
+
Paths always begin at the root of a Redis JSON value. The root is denoted by a period character (`.`). For paths that reference the root's children, it is optional to prefix the path with the root.
254
254
255
-
RedisJSON supports both dot notation and bracket notation for object key access. The following paths refer to _headphones_, which is a child of _inventory_ under the root:
255
+
JSON supports both dot notation and bracket notation for object key access. The following paths refer to _headphones_, which is a child of _inventory_ under the root:
256
256
257
257
*`.inventory.headphones`
258
258
*`inventory["headphones"]`
@@ -264,7 +264,7 @@ To access an array element, enclose its index within a pair of square brackets.
264
264
265
265
By definition, a JSON key can be any valid JSON string. Paths, on the other hand, are traditionally based on JavaScript's (and Java's) variable naming conventions.
266
266
267
-
Although RedisJSON can store objects that contain arbitrary key names, you can only use a legacy path to access these keys if they conform to these naming syntax rules:
267
+
Although JSON can store objects that contain arbitrary key names, you can only use a legacy path to access these keys if they conform to these naming syntax rules:
268
268
269
269
1. Names must begin with a letter, a dollar sign (`$`), or an underscore (`_`) character
270
270
2. Names can contain letters, digits, dollar signs, and underscores
0 commit comments