Handles Redis JSON commands: JSON.SET, JSON.GET, JSON.DEL, JSON.NUMINCRBY, JSON.TYPE, JSON.STRLEN, JSON.OBJKEYS, JSON.OBJLEN, JSON.ARRAPPEND, JSON.ARRLEN, JSON.TOGGLE, JSON.CLEAR, JSON.MGET.
Starting with Redis 8, JSON is part of Redis Open Source. FerricStore v1
stores JSON as raw bytes in Bitcask using a type tag:
:erlang.term_to_binary({:json, json_string}). Every JSON.GET
deserializes and evaluates JSONPath. Every JSON.SET reads, applies
mutation, writes back.
JSONPath subset (v1)
$-- root$.field-- object field access$.field.subfield-- nested access$[0],$[1]-- array index$.field[0].name-- mixed access
Supported commands
JSON.SET key path value [NX|XX]-- set JSON value at pathJSON.GET key [path ...]-- get JSON value(s) at path(s)JSON.DEL key [path]-- delete value at path, returns count deletedJSON.NUMINCRBY key path value-- increment number at pathJSON.TYPE key [path]-- return JSON type at pathJSON.STRLEN key [path]-- return string length at pathJSON.OBJKEYS key [path]-- return object keys at pathJSON.OBJLEN key [path]-- return number of keys in object at pathJSON.ARRAPPEND key path value [value ...]-- append to array at pathJSON.ARRLEN key [path]-- return array length at pathJSON.TOGGLE key path-- toggle boolean at pathJSON.CLEAR key [path]-- clear container or number to zeroJSON.MGET key [key ...] path-- get value at path from multiple keys
Summary
Functions
Handles a JSON command.