JSON module
Valkey JSON stores structured JSON documents and lets you read or change values by JSONPath. Use it when your application needs to work with nested fields or update part of a document.
Confirm the module configuration and required commands with your account support representative when arranging deployment with Momento Cache.
Features
- Store nested objects, arrays, and scalar values as native JSON.
- Select values with JSONPath, including wildcards, array selections, and filter expressions.
- Update individual values, increment numbers, and append array elements without replacing the entire document.
Key commands
Use these Valkey JSON commands to identify the operations your application needs.
| Command | Purpose |
|---|---|
JSON.SET | Set a document or replace a value at a JSONPath. |
JSON.GET | Read serialized JSON from one or more paths. |
JSON.MGET | Read a path from multiple document keys. |
JSON.DEL | Delete values at a path; the root path deletes the key. |
JSON.NUMINCRBY | Increment numeric values at a path. |
JSON.ARRAPPEND | Append values to arrays at a path. |
JSON.ARRLEN | Read array lengths at a path. |
JSON.TYPE | Read the JSON value types at a path. |
Further reading
- Valkey JSON documentation: JSONPath syntax and module behavior.
- Valkey command reference: complete JSON command syntax, arguments, and responses.
- Search module: indexing and querying JSON documents.