Skip to content
Go to file

GitHub issues CircleCI macos Docker Cloud Build Status Forum Discord


RedisJSON is a Redis module that implements ECMA-404 The JSON Data Interchange Standard as a native data type. It allows storing, updating and fetching JSON values from Redis keys (documents).

Primary features:

  • Full support of the JSON standard
  • JSONPath syntax for selecting elements inside documents
  • Documents are stored as binary data in a tree structure, allowing fast access to sub-elements
  • Typed atomic operations for all JSON values types
  • Secondary index support based on RediSearch

Quick start

docker run -p 6379:6379 --name redis-redisjson redislabs/rejson:latest


Read the docs at

New Commands in RedisJSON

JSON.INDEX ADD <index> <field> <path>
JSON.QGET <index> <query> <path>

Next Milestone

JSON.QSET <index> <query> <path> <json> [NX | XX]
JSON.QDEL <index> <query> <path>

JSON.INDEX DEL <index> <field>
JSON.INDEX INFO <index> <field>

Return value from JSON.QGET is an array of keys and values:


In a language such as Java this could be represented as a Map<String, Document>.


A query combining multiple paths:

JSON.QGET mytype "@path1:hello @path2:world"> json.set user1 $ '{"last":"Joe", "first":"Mc"}' INDEX person
OK> json.set user2 $ '{"last":"Joan", "first":"Mc"}' INDEX person
OK> json.index add person last $.last
OK> JSON.QGET person Jo*
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}]}"> json.set user3 $ '{"last":"Joel", "first":"Dan"}' INDEX person
OK> JSON.QGET person Jo*
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}],\"user3\":[{\"last\":\"Joel\",\"first\":\"Dan\"}]}"> json.index add person first $.first
OK> JSON.QGET person Mc
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}]}"> JSON.QGET person Mc $.last
"{\"user2\":[\"Joan\"],\"user1\":[\"Joe\"]}"> JSON.QGET person "@last:Jo* @first:Mc" $.last


cargo build --release



redis-server --loadmodule ./target/release/

Mac OS

redis-server --loadmodule ./target/release/librejson.dylib

Client libraries

Some languages have client libraries that provide support for RedisJSON's commands:

Project Language License Author URL
iorejson Node.js MIT Evan Huang @evanhuang8 git npm
node_redis-rejson Node.js MIT Kyle Davis @stockholmux git npm
JReJSON Java BSD-2-Clause Redis Labs git
rejson-py Python BSD-2-Clause Redis Labs git pypi
go-rejson (multiple clients) Go MIT Nitish Malhotra @nitishm git
jonson (go-redis client) Go Apache-2.0 Daniel Krom @KromDaniel git
NReJSON .NET MIT/Apache-2.0 Tommy Hanks @tombatron git
phpredis-json PHP MIT Rafa Campoy @averias git
redislabs-rejson PHP MIT Mehmet Korkmaz @mkorkmaz git
rejson-rb Ruby MIT Pavan Vachhani @vachhanihpavan git rubygems


RedisJSON is developed with <3 at Redis Labs.

RedisJSON is made possible only because of the existance of this amazing open source project:


Redis Source Available License Agreement - see LICENSE

You can’t perform that action at this time.