Skip to content

Commit

Permalink
Tweaks to the presentation of the ne JSON guide
Browse files Browse the repository at this point in the history
  • Loading branch information
tishun committed Sep 30, 2024
1 parent eb93605 commit 38aa003
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
21 changes: 12 additions & 9 deletions docs/user-guide/redis-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ The driver generally allows three distinct ways of working with the RedisJSON mo
* (Advanced mode) - custom JSON parsing using a user-provided JSON parser
* (Power-user mode) - unprocessed JSON documents that have not gone through any process of deserialization or serialization

> [!IMPORTANT]\
> In all the above modes, the driver would refrain from processing the JSON document in the main event loop and instead
delegate this to the user thread. This behaviour is consistent when both receiving and sending JSON documents - when
receiving the parsing is done lazily whenever a method is called that requires the JSON to be parsed; when sending the
JSON is serialized immediately after it is passed to any of the commands, but before dispatching the command to the
event loop.
!!! NOTE
In all the above modes, the driver would refrain from processing the JSON document in the main event loop and instead
delegate this to the user thread. This behaviour is consistent when both receiving and sending JSON documents - when
receiving the parsing is done lazily whenever a method is called that requires the JSON to be parsed; when sending the
JSON is serialized immediately after it is passed to any of the commands, but before dispatching the command to the
event loop.


## Default mode
Best for:

* Most typical use-cases where the JSON document is parsed and processed

### Example usage:
### Example usage

```java
RedisURI redisURI = RedisURI.Builder.redis("acme.com").build();
Expand Down Expand Up @@ -52,9 +53,10 @@ try (StatefulRedisConnection<ByteBuffer, ByteBuffer> connect = redisClient.conne

## Advanced mode
Best for:

* Applications that want to handle parsing manually - either by using another library or by implementing their own parser

### Example usage:
### Example usage

```java
RedisURI redisURI = RedisURI.Builder.redis("127.0.0.1").withPort(16379).build();
Expand All @@ -68,9 +70,10 @@ try (RedisClient client = RedisClient.create(redisURI)) {

## Power-user mode
Best for:

* Applications that do little to no processing on the Java layer

### Example usage:
### Example usage

```java
JsonPath myPath = JsonPath.of("$..mountain_bikes");
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ nav:
- Kotlin API: user-guide/kotlin-api.md
- Publish/Subscribe: user-guide/pubsub.md
- Transactions/Multi: user-guide/transactions-multi.md
- Redis JSON: user-guide/redis-json.md
- Redis programmability:
- LUA Scripting: user-guide/lua-scripting.md
- Redis Functions: user-guide/redis-functions.md
Expand Down

0 comments on commit 38aa003

Please sign in to comment.