Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 20, 2020. It is now read-only.
/RedisJSON2Public archive

Rust based RedisJSON implementation - Deprecated and moved to RedisJSON/RedisJSON

License

NotificationsYou must be signed in to change notification settings

RedisJSON/RedisJSON2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub issuesCircleCIDocker Cloud Build StatusMailing ListGitter

RedisJSON2

RedisJSON2 (RedisJSON nextgen) is aRedis module that implementsECMA-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 onRediSearch

Quick start

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

New Commands in RedisJSON2

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:

keyjsonkeyjson

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

Examples

A query combining multiple paths:

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

Build

cargo build --release

Run

Linux

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

Mac OS

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

About

Rust based RedisJSON implementation - Deprecated and moved to RedisJSON/RedisJSON

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp