RedisJSON - a JSON data type for Redis

Overview

GitHub issues CircleCI macos Dockerhub Total alerts

RedisJSON

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

Documentation

Read the docs at http://redisjson.io

Build

Make sure you have Rust installed: https://www.rust-lang.org/tools/install

Then, build as usual:

cargo build --release

When running the tests, you need to explicitly specify the test feature to disable use of the Redis memory allocator when testing:

cargo test --features test

If you forget to do this, you'll see an error mentioning signal: 4, SIGILL: illegal instruction.

Run

Linux

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

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 Stars Package
iorejson Node.js MIT Evan Huang @evanhuang8 iorejson-stars npm
node_redis-rejson Node.js MIT Kyle Davis @stockholmux node_redis-rejson-stars npm
redis-modules-sdk Node.js BSD-3-Clause Dani Tseitlin @danitseitlin redis-modules-sdk-stars npm
ioredis-rejson Node.js MIT Felipe Schulz @schulzf ioredis-rejson-stars npm
JRedisJSON Java BSD-2-Clause Redis Labs JRedisJSON-stars maven
redis-modules-java Java Apache-2.0 Liming Deng @dengliming redis-modules-java-stars maven
redisjson-py Python BSD-2-Clause Redis Labs rejson-py-stars pypi
go-rejson Go MIT Nitish Malhotra @nitishm go-rejson-stars
rejonson Go Apache-2.0 Daniel Krom @KromDaniel rejonson-stars
NReJSON .NET MIT/Apache-2.0 Tommy Hanks @tombatron NReJSON-stars nuget
phpredis-json PHP MIT Rafa Campoy @averias phpredis-json-stars composer
redislabs-rejson PHP MIT Mehmet Korkmaz @mkorkmaz redislabs-rejson-stars composer
rejson-rb Ruby MIT Pavan Vachhani @vachhanihpavan rejson-rb-stars rubygems

Acknowledgements

RedisJSON is developed with <3 at Redis Labs.

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

License

Redis Source Available License Agreement - see LICENSE

Comments
  • Mac Configuration Issues

    Mac Configuration Issues

    I was able to clone the repository, install cmake via brew, run the bootstrap.sh file and had no errors when doing so. However, when I explored the lib directory, instead of getting a rejson.so file, the directory had a rejson.dylib. When I attempted run the loadmodule command, I errored out.

    $ redis-server /usr/local/etc/redis.conf
    
    *** FATAL CONFIG FILE ERROR ***
    Reading the configuration file, at line 181
    >>> 'loadmodule /Users/sampastoriza/rejson/lib/rejson.dylib'
    Bad directive or wrong number of arguments
    

    Any thoughts on what might be happening here? Is there another location for the rejson.so file? Thanks!

    opened by pastorsj 35
  • Cross-compile #2 for ARMv7 on host machine

    Cross-compile #2 for ARMv7 on host machine

    After faced a lot of obstacles with yocto recipe decide to cross-compile localy and put lib in distro (#471) I've tried to build with cargo test --lib --target armv7-unknown-linux-gnueabihf But test failed:

    Compiling cfg-if v1.0.0
    Compiling hashbrown v0.11.2
    Compiling itoa v0.4.8
    Compiling ppv-lite86 v0.2.10
    Compiling md5 v0.6.1
    Compiling linked-hash-map v0.5.4
    Compiling hex v0.3.2
    Compiling byteorder v1.4.3
    Compiling bitflags v1.3.2
    Compiling array_tool v1.0.3
    Compiling libc v0.2.100
    Compiling ryu v1.0.5
    Compiling num-traits v0.2.14
    Compiling serde v1.0.128
    Compiling log v0.4.14
    Compiling indexmap v1.7.0
    Compiling getrandom v0.1.16
    Compiling time v0.1.44
    Compiling rand_core v0.5.1
    Compiling num-integer v0.1.44
    Compiling redis-module v0.23.0
    Compiling rand_chacha v0.2.2
    Compiling chrono v0.4.19
    Compiling rand v0.7.3
    Compiling serde_json v1.0.66
    Compiling bson v0.14.1
    Compiling jsonpath_lib v0.2.6 (https://github.com/RedisJSON/jsonpath.git?branch=generic_json_path#14af7aa5)
    Compiling redisjson v99.99.99 (/home/topper/work/RedisJSON)
     Finished test [unoptimized + debuginfo] target(s) in 11.19s
      Running unittests (target/armv7-unknown-linux-gnueabihf/debug/deps/rejson-1904ab6883c9f070)
    arm-binfmt-P: Could not open '/lib/ld-linux-armhf.so.3': No such file or directory
    error: test failed, to rerun pass '--lib'
    

    Anyway I've build with cargo build --target armv7-unknown-linux-gnueabihf or cargo build --target armv7-unknown-linux-gnueabihf --realease

    $ file ./target/armv7-unknown-linux-gnueabihf/debug/librejson.so
    ./target/armv7-unknown-linux-gnueabihf/debug/librejson.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=6786ceee1448c5d48153f1978aea1c11715b53fc, with debug_info, not stripped
    

    but when copied in dev-board with i.MX6Q

    Module /etc/redis/librejson.so failed to load: /lib/libm.so.6: version GLIBC_2.29 not found (required by /etc/redis/librejson.so)

    How I could cross-compile it (static?) with desirable libc (on Yocto 2.6 that is libc-2.28.so)

    opened by TopperBG 17
  • Unconventional JSON.GET behaviour when the path does not exist

    Unconventional JSON.GET behaviour when the path does not exist

    ReJSON version: 1.0.2 Redis version: 4.0.10

    The behavior of JSON.GET is inconsistent with JSON.MGET, built-in GET, and JavaScripts interpreters when an object key on the path does not exist. JSON.GET returns an error instead of nil which leads to the anti-pattern of using exceptions as a part of the control flow.

    Consider the following example where the key foo does not exist and the key bar contains JSON {"baz": {"biz": "qux"}}. Let us try to access the missing key foo first:

    > GET foo
    (nil)
    > JSON.GET foo
    (nil)
    > JSON.MGET foo
    (empty list or set)
    > JSON.MGET foo .
    1) (nil)
    

    Okay, mostly nils. Let us then access a missing object key within the existing key bar.

    > JSON.MGET bar foo
    1) (nil)
    > JSON.GET bar foo
    (error) ERR key 'foo' does not exist at level 0 in path
    > JSON.MGET bar baz.foo
    1) (nil)
    > JSON.GET bar baz.foo
    (error) ERR key 'foo' does not exist at level 1 in path
    

    Spot the inconsistensies of JSON.GET? Finally, let us try how similar JavaScript object behave in Node.js interpreter:

    > foo
    ReferenceError: foo is not defined
    > foo.bar
    ReferenceError: foo is not defined
    > bar.foo
    undefined
    > bar.baz
    { biz: 'qux' }
    > bar.foo.biz
    TypeError: Cannot read property 'biz' of undefined
    

    A nullish value undefined is returned when the last part of the path does not exist.

    In addition, the behaviour of JSON.GET forces the programmer to use the error as a part of the program control flow. Using exceptions as part of the control flow is a known anti-pattern. For example, sometimes the server must return a default document if the path does not exist. Here the non-existent path is not necessarily a sign of an error, it is just a part of the state.

    As a last note, one could erroneusly think that without an error it is hard to differentiate between a missing key and a null value. This is false because a missing key should return (nil) and an existing key with null JSON string returns a string "null".

    I would like to see JSON.GET foo to return (nil) that seems to be the convention and not an anti-pattern.

    enhancement no-issue-activity 
    opened by axelpale 17
  • JSON.ARRAPPEND: cpu bound

    JSON.ARRAPPEND: cpu bound

    I'm using JSON.ARRAPPEND to append GeoJSON features as they are received to a GeoJSON LineString coordinates array and corresponding properties

    array length are < 5000

    redis-server becomes CPU-bound in this method (all top 10 ops reported by SLOWLOG get are JSON.ARRAPPEND)

    any suggestions?

    q:performance 
    opened by mhaberler 13
  • Bug report using rejson module

    Bug report using rejson module

    1:C 21 Feb 06:10:59.107 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 1:C 21 Feb 06:10:59.107 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started 1:C 21 Feb 06:10:59.107 # Configuration loaded 1:M 21 Feb 06:10:59.107 * Running mode=standalone, port=6379. 1:M 21 Feb 06:10:59.107 # Server initialized 1:M 21 Feb 06:10:59.107 # JSON data type for Redis v1.0.1 [encver 0] 1:M 21 Feb 06:10:59.107 * Module 'ReJSON' loaded from /usr/lib/redis/modules/rejson.so 1:M 21 Feb 06:10:59.107 * Ready to accept connections

    === REDIS BUG REPORT START: Cut & paste starting from here === *** Error in `redis-server *:6379': free(): invalid pointer: 0x0000000000b704d4 *** 1:M 21 Feb 06:15:27.891 # Redis 4.0.1 crashed by signal: 11 1:M 21 Feb 06:15:27.891 # Crashed running the instuction at: 0x7f29e1682532 1:M 21 Feb 06:15:27.891 # Accessing address: (nil) 1:M 21 Feb 06:15:27.891 # Failed assertion: (:0)

    ------ STACK TRACE ------ EIP: /lib/x86_64-linux-gnu/libc.so.6(abort+0x232)[0x7f29e1682532]

    Backtrace: redis-server *:6379(logStackTrace+0x29)[0x467a89] redis-server *:6379(sigsegvHandler+0xa6)[0x468126] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf890)[0x7f29e1a06890] /lib/x86_64-linux-gnu/libc.so.6(abort+0x232)[0x7f29e1682532] /lib/x86_64-linux-gnu/libc.so.6(+0x731b4)[0x7f29e16bf1b4] /lib/x86_64-linux-gnu/libc.so.6(+0x7898e)[0x7f29e16c498e] /lib/x86_64-linux-gnu/libc.so.6(+0x79696)[0x7f29e16c5696] /usr/lib/redis/modules/rejson.so(+0x6465)[0x7f29df7e8465]

    ------ INFO OUTPUT ------

    Server

    redis_version:4.0.1 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:ac6c9ffb15b04a74 redis_mode:standalone os:Linux 4.9.60-linuxkit-aufs x86_64 arch_bits:64 multiplexing_api:epoll atomicvar_api:atomic-builtin gcc_version:4.9.2 process_id:1 run_id:80ed610f3db494ed197698d0960071111c1e4b71 tcp_port:6379 uptime_in_seconds:268 uptime_in_days:0 hz:10 lru_clock:9244287 executable:/data/redis-server config_file:

    Clients

    connected_clients:1 client_longest_output_list:0 client_biggest_input_buf:0 blocked_clients:0

    Memory

    used_memory:1217928 used_memory_human:1.16M used_memory_rss:4640768 used_memory_rss_human:4.43M used_memory_peak:1217928 used_memory_peak_human:1.16M used_memory_peak_perc:100.53% used_memory_overhead:825590 used_memory_startup:765592 used_memory_dataset:392338 used_memory_dataset_perc:86.74% total_system_memory:6246981632 total_system_memory_human:5.82G used_memory_lua:37888 used_memory_lua_human:37.00K maxmemory:0 maxmemory_human:0B maxmemory_policy:noeviction mem_fragmentation_ratio:3.81 mem_allocator:jemalloc-4.0.3 active_defrag_running:0 lazyfree_pending_objects:0

    Persistence

    loading:0 rdb_changes_since_last_save:0 rdb_bgsave_in_progress:0 rdb_last_save_time:1519193459 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:-1 rdb_current_bgsave_time_sec:-1 rdb_last_cow_size:0 aof_enabled:0 aof_rewrite_in_progress:0 aof_rewrite_scheduled:0 aof_last_rewrite_time_sec:-1 aof_current_rewrite_time_sec:-1 aof_last_bgrewrite_status:ok aof_last_write_status:ok aof_last_cow_size:0

    Stats

    total_connections_received:2 total_commands_processed:1062 instantaneous_ops_per_sec:73 total_net_input_bytes:165284 total_net_output_bytes:210320 instantaneous_input_kbps:10.91 instantaneous_output_kbps:12.67 rejected_connections:0 sync_full:0 sync_partial_ok:0 sync_partial_err:0 expired_keys:0 evicted_keys:0 keyspace_hits:618 keyspace_misses:208 pubsub_channels:0 pubsub_patterns:0 latest_fork_usec:0 migrate_cached_sockets:0 slave_expires_tracked_keys:0 active_defrag_hits:0 active_defrag_misses:0 active_defrag_key_hits:0 active_defrag_key_misses:0

    Replication

    role:master connected_slaves:0 master_replid:02d014ce08a9b63bdcd5878a45d17f59f3e8509b master_replid2:0000000000000000000000000000000000000000 master_repl_offset:0 second_repl_offset:-1 repl_backlog_active:0 repl_backlog_size:1048576 repl_backlog_first_byte_offset:0 repl_backlog_histlen:0

    CPU

    used_cpu_sys:0.19 used_cpu_user:0.08 used_cpu_sys_children:0.00 used_cpu_user_children:0.00

    Commandstats

    cmdstat_select:calls=3,usec=3,usec_per_call=1.00 cmdstat_info:calls=3,usec=106,usec_per_call=35.33

    Cluster

    cluster_enabled:0

    Keyspace

    db2:keys=208,expires=0,avg_ttl=0

    ------ CLIENT LIST OUTPUT ------ id=3 addr=172.17.0.1:39676 fd=8 name= age=41 idle=0 flags=N db=2 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=json.set

    ------ CURRENT CLIENT INFO ------ id=3 addr=172.17.0.1:39676 fd=8 name= age=41 idle=0 flags=N db=2 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=json.set argv[0]: 'JSON.SET' argv[1]: 'calendar:745fcaf2-3507-4843-8f5a-0d63495f419d' argv[2]: '.' argv[3]: '{"events":[{"start":"2018-02-01T09:30:00.000Z","end":"2018-02-01T10:00:00.000Z","resources":{"places":{"qty":12,"use":12},"adults":{"qty":10,"use":10},"children":{"qty":2,"use":2},"infants":{"qty":2}}},{"start":"2018-02-01T09:00:00.000Z","end":"2018-02-01T09:30:00.000Z","resources":{"places":{"qty":12,"use":12},"adults":{"qty":10,"use":10},"children":{"qty":2,"use":2},"infants":{"qty":2}}},{"start":"2018-02-01T10:00:00.000Z","end":"2018-02-01T10:30:00.000Z","resources":{"places":{"qty":12,"use":12},"adults":{"qty":10,"use":10},"children":{"qty":2,"use":2},"infants":{"qty":2}}}]}'

    ------ REGISTERS ------ 1:M 21 Feb 06:15:27.892 # RAX:0000000000000006 RBX:0000000000000054 RCX:00007f29e1681067 RDX:0000000000000006 RDI:0000000000000001 RSI:0000000000000001 RBP:00007ffdba2112a0 RSP:00007ffdba210f10 R8 :0000000000000000 R9 :00007ffdba210e60 R10:0000000000000008 R11:0000000000000202 R12:00007ffdba2110b0 R13:0000000000000007 R14:0000000000000054 R15:0000000000000007 RIP:00007f29e1682532 EFL:0000000000010246 CSGSFS:002b000000000033 1:M 21 Feb 06:15:27.892 # (00007ffdba210f1f) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f1e) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f1d) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f1c) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f1b) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f1a) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f19) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f18) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f17) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f16) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f15) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f14) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f13) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f12) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f11) -> 0000000000000000 1:M 21 Feb 06:15:27.892 # (00007ffdba210f10) -> 0000000000000020

    ------ FAST MEMORY TEST ------ 1:M 21 Feb 06:15:27.892 # Bio thread for job type #0 terminated 1:M 21 Feb 06:15:27.892 # Bio thread for job type #1 terminated 1:M 21 Feb 06:15:27.893 # Bio thread for job type #2 terminated *** Preparing to test memory region 752000 (94208 bytes) *** Preparing to test memory region b47000 (266240 bytes) *** Preparing to test memory region 7f29df9fe000 (8388608 bytes) *** Preparing to test memory region 7f29e01ff000 (8388608 bytes) *** Preparing to test memory region 7f29e0a00000 (12582912 bytes) *** Preparing to test memory region 7f29e19f3000 (16384 bytes) *** Preparing to test memory region 7f29e1c10000 (16384 bytes) *** Preparing to test memory region 7f29e2330000 (24576 bytes) *** Preparing to test memory region 7f29e2336000 (12288 bytes) *** Preparing to test memory region 7f29e233b000 (4096 bytes) .O.O.O.O.O.O.O.O.O.O Fast memory test PASSED, however your memory can still be broken. Please run a memory test for several hours if possible.

    ------ DUMPING CODE AROUND EIP ------ Symbol: abort (base: 0x7f29e1682300) Module: /lib/x86_64-linux-gnu/libc.so.6 (base 0x7f29e164c000) $ xxd -r -p /tmp/dump.hex /tmp/dump.bin $ objdump --adjust-vma=0x7f29e1682300 -D -b binary -m i386:x86-64 /tmp/dump.bin

    1:M 21 Feb 06:15:27.955 # dump of function (hexdump of 690 bytes): 4881ec2801000064488b142510000000483b15010937007434be0100000031c0833dad443700007410f00fb135df0837000f8510020000eb0d0fb135d00837000f8501020000488915cb0837008b05cd0837008305ba0837000185c0744583f801747983f8020f849000000083f803900f841f01000083f8040f847201000083f8050f848701000083f8060f84a101000083f8070f8499010000660f1f440000f4ebfd31c0b9100000004889e7f348ab31d24889e6bf01000000c7055c0837000100000048c7042420000000e82fefffff8b054908370083f801758731ffc7053808370002000000e8930304008b052d08370083f8020f8570ffffff832d1108370001c7051308370000000000752f48c705fe07370000000000833db343370000740ff0ff0de60737000f8536010000eb0cff0dd80737000f8528010000bf06000000e8e8ebffff64488b142510000000483b15c00737007434be0100000031c0833d6c433700007410f00fb1359e0737000f850d010000eb0d0fb1358f0737000f85fe0000004889158a07370083057f07370001488d942480000000b91300000031c0c70572073700040000004889d7488db280000000f348ab48c706ffffffff4883ee084839d675f031d2bf06000000c784240801000000000000e8feedffff8b053807370083f8040f858efeffffc7052507370005000000e8b0c203008b051a07370083f8050f8579feffffbf06000000c7050207370006000000e80debffff8b05f706370083f8060f855ffefffff4bf7f000000c705de06370008000000e8693d0800488d3dc20637004881ec80000000e836e60b004881c480000000e9e0fdffff488d3da30637004881ec80000000e847e60b004881c480000000e9b9feffff488d3d840637004881ec80000000e8f8e50b004881c480000000e9e3feffff662e0f1f84000000000066904157 Function at 0x7f29e1681300 is sigprocmask Function at 0x7f29e1681030 is gsignal Function at 0x7f29e16812e0 is sigaction Function at 0x7f29e16be7b0 is fcloseall Function at 0x7f29e17062b0 is _exit

    === REDIS BUG REPORT END. Make sure to include from START to END. ===

       Please report the crash by opening an issue on github:
    
           http://github.com/antirez/redis/issues
    
    no-issue-activity 
    opened by jeremy-moore 13
  • unicode support in rejson

    unicode support in rejson

    I'm trying to store a json with some chinese character in redis with rejson like this:

    127.0.0.1:6379> JSON.SET test . '{"key":"测试"}'
    OK
    127.0.0.1:6379> JSON.GET test .key
    "\u00e6\u00b5\u008b\u00e8\u00af\u0095"
    127.0.0.1:6379> SET test2 "测试"
    OK
    127.0.0.1:6379> GET test2 
    测试
    127.0.0.1:6379> 
    

    As you can see the value "测试" convert to "\u00e6\u00b5\u008b\u00e8\u00af\u0095" when using JSON.GET... It looks like rejson didn't support unicode yet...

    opened by wgjak47 13
  • NOESCAPE in JSON.MGET

    NOESCAPE in JSON.MGET

    Hi, related to #35

    I've found that #35 was solved for JSON.GET, but in my case I require the same thing on JSON.MGET. Any chance to get the same feature in this command?

    Thank you in advance

    opened by mfidemraizer 11
  • redis-server crashes after loading module

    redis-server crashes after loading module

    I was following this guide.

    Everything was fine, until I added the loadmodule directive in redis.conf

    After adding it and restarting the redis-server, it get's hung up until timeout:

    Job for redis-server.service failed because a timeout was exceeded.
    See "systemctl status redis-server.service" and "journalctl -xe" for details.
    

    $ sudo service redis-server status

    ● redis-server.service - Advanced key-value store
       Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
       Active: activating (start) since Sat 2019-01-19 05:51:00 UTC; 13s ago
         Docs: http://redis.io/documentation,
               man:redis-server(1)
      Process: 23037 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
      Process: 24593 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
     Main PID: 22625 (code=exited, status=0/SUCCESS)
        Tasks: 0 (limit: 1152)
       CGroup: /system.slice/redis-server.service
    
    Jan 19 05:51:00 XXXXXX systemd[1]: redis-server.service: Service hold-off time over, scheduling restart.
    Jan 19 05:51:00 XXXXXX systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 3.
    Jan 19 05:51:00 XXXXXX systemd[1]: Stopped Advanced key-value store.
    Jan 19 05:51:00 XXXXXX systemd[1]: Starting Advanced key-value store...
    Jan 19 05:51:00 XXXXXX systemd[1]: redis-server.service: Can't open PID file /var/run/redis/redis-server.pid (yet?) after start: No such file or directory
    

    $ redis-cli

    Could not connect to Redis at 127.0.0.1:6379: Connection refused
    Could not connect to Redis at 127.0.0.1:6379: Connection refused
    not connected> 
    

    $ sudo tail /var/log/redis/redis-server.log

          `-._    `-.__.-'    _.-'                                       
              `-._        _.-'                                           
                  `-.__.-'                                               
    
    24737:M 19 Jan 05:55:31.911 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    24737:M 19 Jan 05:55:31.911 # Server initialized
    24737:M 19 Jan 05:55:31.911 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    24737:M 19 Jan 05:55:31.911 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
    24737:M 19 Jan 05:55:31.911 # Module /home/XXXXXX/rejson/rejson/src/rejson.so failed to load: /home/XXXXXX/rejson/rejson/src/rejson.so: cannot open shared object file: Permission denied
    24737:M 19 Jan 05:55:31.911 # Can't load module from /home/XXXXXX/rejson/rejson/src/rejson.so: server aborting
    

    If I comment out the loadmodule for rejson on redis.conf and restart, then everything works fine.

    OS: Ubuntu 18.04 Redis server v=4.0.9 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=76095d16786fbcba

    Thanks!

    opened by Ignasimg 10
  • ReJson first version

    ReJson first version

    I understand current version is Beta quality (please correct, if that's not true).

    What is the roadmap ahead? When do we expect first version, with production ready quality?

    opened by hiren-intellectdesign 10
  • How to filter an item in JSON.array

    How to filter an item in JSON.array

    Hi Team, I would like to filter an item via "uid" from key "D" which is a JSON.array

    {
      "MTYxNTkwMTY5Mzk2Nw-meet": {
        "A": [],
        "B": "discussion",
        "C": "created",
        "D": [
          {
            "uid": "5c0bd0471849cbf4ac34df49"
          }
        ]
      }
    }
    
    question 
    opened by ashifa454 9
  • Unexpected behaviour with filters!

    Unexpected behaviour with filters!

    I have been using Redis Json for months with no trouble, using the docker container. I finally decided to run Redis on my computer without docker. I have it installed and i have the Redis-Json module installed too and working normally, but there is something wrong which i can't understand why it happens. Here it is in only two commands given to the redis-cli:

    First command: JSON.SET places $ '[ {"continent": "europe", "people": [] }, {"continent": "asia", "people": [] } ]'

    Second command: JSON.ARRAPPEND places '$.*[?(@.continent=="asia")].people' '{ "name":"john", "age":12 }'

    These two commands work perfectly when run with the redis-json docker container, but gives this error when run in Redis version 7.0.5 and version 6.0.16, without docker: (empty array) .

    opened by 0xhiro 8
Releases(v2.4.3)
  • v2.4.3(Dec 29, 2022)

    This is a maintenance release for RedisJSON 2.4

    Update urgency: MODERATE: Program an upgrade of the server, but it's not urgent.

    Details

    Bug fixes:

    • #890 JSONPath ignores any filter condition beyond the second (MOD-4602)

    Improvements:

    • #892 Allow JSON.ARRINDEX with none scalar values
    Source code(tar.gz)
    Source code(zip)
  • v2.4.2(Nov 30, 2022)

    This is the General Availability release of RedisJSON 2.4.

    Highlights

    This version contains several low-level API changes in order to support the multi-value indexing and querying support that comes with RediSearch 2.6. RediSearch 2.6 comes with multi-value indexing and querying of attributes for any attribute type (Text, Tag, Numeric, Geo and Vector) defined by a JSONPath leading to an array or to multiple scalar values.

    Details

    Features:

    • #848 Add JSONPath filter the regexp match operator (MOD-4432)
    • #861 Support legacy JSONpath with dollar $ (MOD-4436)

    Performance Enhancements:

    • #699 A new JSONPath library which enhances the performance of parsing any JSONPath expression in RedisJSON.

    Changing Behaviour:

    • #699 Floating point numbers which become round numbers due to some operation, for example by JSON.NUMINCRBY, will now return as a floating point with a trailing .0, e.g., instead of just 42, now 42.0 will be returned.

    Bugs fixes (since 2.4-RC1/ v2.4.0):

    • #850 Allow repetition of filter relation instead of optional (MOD-4431)

    Notes:

    • The version inside Redis will be 2.4.2 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a GA flag.
    • Minimal Redis version: 6.0
    • License update: see LICENSE.txt
    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Oct 31, 2022)

    This is the first Release Candidate of RedisJSON 2.4

    Highlights

    This version contains several low level API changes in order to support the multi-value indexing and querying support that comes with RediSearch 2.6. RediSearch 2.6 comes with multi-value indexing and querying of attributes for any attribute type (Text, Tag, Numeric, Geo and Vector) defined by a JSONPath leading to an array.

    Details

    Performance Enhancements:

    • #699 A new JSONPath library which enhances the performance of parsing any JSONPath expression in RedisJSON.

    Bug Fixes:

    • #699 Floating point numbers which become round numbers due to some operation, for example by JSON.NUMINCRBY, will now return as a floating point with a trailing .0, e.g., instead of just 42, now 42.0 will be returned.

    Notes:

    • The version inside Redis will be 2.4.0 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a Release Candidate flag. The GA version will follow soon.
    • Minimal Redis version: 6.0
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Jul 27, 2022)

    This is the General Availability release of RedisJSON 2.2.

    Headlines

    This release adds support for the JSON data structure as a CRDT (Conflict-free Replicated Data) when used with Redis Enterprise Active-Active databases. The behaviour of the Data structure is documented here.

    Details

    Enhancements

    • #758 Add support for COPY
    Source code(tar.gz)
    Source code(zip)
  • v2.0.11(Jul 17, 2022)

    This is a maintenance release for RedisJSON 2.0. Update urgency: LOW - No need to upgrade unless there are new features you want to use.

    Details

    Improvements

    • Minor documentation changes and internal build improvements
    Source code(tar.gz)
    Source code(zip)
  • v2.0.9(Jun 2, 2022)

    This is a maintenance release for RedisJSON 2.0. Update urgency: LOW: No need to upgrade unless there are new features you want to use.

    Details

    Bugfixes

    • #721: Skip String and Boolean scalars in JSON.CLEAR (MOD-3136)

    Improvements

    • #709: Allow internal JSON API getdouble to succeed with integer values.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.8(Apr 18, 2022)

    This is a maintenance release for RedisJSON 2.0. Update urgency: LOW - No need to upgrade unless there are new features you want to use.

    Details

    Bug fixes

    • #691, #667 Duplicate results in JSONPath query

    Known issues

    • The JSON.CLEAR mistakenly added support for Sting and Boolean values. Starting from v2.0.9 we only support containers (arrays and objects) and numeric scalars.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.7(Mar 11, 2022)

    This is a maintenance release for RedisJSON 2.0. Update urgency: LOW - No need to upgrade unless there are new features you want to use.

    Details:

    Improvements

    • #632, #605 Support JSON.CLEAR for numeric scalars (MOD-2394)
    • #637 Add intershard_tls_pass support (MOD-2522)
    • #594 Support for MEMORY USAGE and memory info in JSON.DEBUG (MOD- 2079)

    Bug fixes

    • #646,#644 do not fail JSON.MGET on wrong/unregistered key type (MOD-2511)
    • #643 null-terminate JSON string in rdb_save
    • #591 Avoid crash on overflow in JSON.NUMINCRBY or JSON.NUMMULTBY (MOD-2513)
    • #593 Return no updates when performing JSON.SET with NX to an existing array element (MOD-2512)

    Known issues

    • #632, #605 The JSON.CLEAR mistakenly added support for Sting and Boolean values. Starting from v2.0.9 we only support containers (arrays and objects) and numeric scalars.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.6(Dec 18, 2021)

    This is a maintenance release for RedisJSON 2.0.

    Update urgency: MODERATE: Program an upgrade of the server, but it's not urgent.

    This patch neutralises the increased memory consumption from v1 to v2.

    Details

    Improvements:

    • #563 Introduction of ijson.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.5(Dec 1, 2021)

    This is a maintenance release for RedisJSON 2.0.

    Update urgency: MODERATE: Program an upgrade of the server, but it's not urgent.

    Details

    Bug fixes:

    • #553 Return an empty array on a non-existing path
    • #548 Align error handling behavior
    • #546 #545 Fix key location in JSON.DEBUG MEMORY
    Source code(tar.gz)
    Source code(zip)
  • v2.0.4(Nov 16, 2021)

    This is the General Availability release of RedisJSON 2.0.

    Headlines

    RedisJSON is a high-performance JSON document store that allows developers to build modern applications. It stores and processes JSON in-memory, supporting millions of operations per second with sub-millisecond response times. With the combination of RediSearch, native indexing, querying, and full-text search of JSON documents allows developers to create secondary indexes, and query data at lightning speed.

    Indexing JSON documents

    Using RediSearch, it is now possible to index, query, and search JSON documents, gaining full-text search capabilities and document retrieving based on their content.

    To do so, you must install both modules, RedisJSON and RediSearch on the same database.

    Support of JSON Path

    The commands support JSONPath as specified in the original specifications.

    The legacy path syntax is still supported.

    Commands operate on multiple paths.

    A JSONPath query may resolve to several paths. Every command supports multiple paths and applies the operation to all the encountered paths.

    Notice that the output of the commands evolved to provide multiple results according to the number of paths impacted.

    Details

    Enhancements

    • Support of Multipath - (#473)(#477) (#491(#531) (#519)(#511)(#503) (#497) (#516)
    • Added generic json path implementation (#336)
    • Error messages prefixed with ERR or WRONGTYPE (#525)
    • Performance: Discard of method to_value (#490)
    • Move from next_string to next_str (#426)
    • Initial RedisJSON commands.json file (#464)
    • Docker with RediSearch revisited (#488)

    Bug fixes

    • JSON.DEL count deleted null value (#515)
    • Avoid crash in ARRTRIM (#499)
    • Docker/Debian: moved from Buster to Bullseye (#458)
    • Support RDB Short Read in RedisJSON (a.k.a diskless-load) (#397)
    • Avoid path clone when not needed (#398)
    • Add testGetWithBracketNotation (#416)

    Notes: This is the first GA version of 2.0. The version inside Redis will be 2.0.4 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a GA flag.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.8(Aug 10, 2021)

    This is a maintenance release for version 1.0. Update urgency: LOW - No need to upgrade unless there are new features you want to use.

    Headlines: This release improves overall stability and provides fixes for issues found after the previous release.

    Details:

    • Enhancements:

      • #257 Support inter shards TLS capability
    • Bug fixes:

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Jul 7, 2021)

    This is the first release candidate for RedisJSON 2.0

    Highlights:

    This release includes two major new features:

    • Full support for JSONPath with JSON.GET when using a regular JSONPath expression (starting with $).
    • Introduction of an API exposing the JSON data type to RediSearch. This is related to RediSearch 2.2-RC1.

    Lean more by reading the blog post: Indexing, querying and full-text search of JSON documents with Redis

    Notes:

    • Requires Redis v6 or above
    • This is not the GA version of 2.0. The version inside Redis will be 20000 or 2.0.0 in semantic versioning. Since the version of a module in Redis is numeric, we could not add an RC1 flag.
    • For production usage, please use the latest RedisJSON 1.0.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.7(Dec 30, 2020)

    This is a maintenance release for version 1.0. Update urgency: Medium

    Headlines: This release improves overall stability and provides fixes for issues found after the previous release.

    Details:

    • #222 Validate path is not empty.
    • #253 NULL de-reference after error.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Sep 7, 2020)

    This is a maintenance release for version 1.0. Update urgency: Low

    Headlines:

    • This release improves overall stability and provides fixes for issues found after the previous release.

    Details:

    • Enhancements:
      • Republish docker image based on Redis 6
    • Bugfixes:
      • #200 Following a call to JSON.ARRPOP and JSON.STRAPPEND, the LRU cache should be invalidated.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Sep 12, 2018)

  • v1.0.2(Sep 10, 2018)

  • v0.99.1(Nov 14, 2017)

  • v0.99.0(Nov 14, 2017)

Owner
A Redis module that implements JSON as a native data type.
null
Scalable and fast data store optimised for time series data such as financial data, events, metrics for real time analysis

OnTimeDB Scalable and fast data store optimised for time series data such as financial data, events, metrics for real time analysis OnTimeDB is a time

Stuart 2 Apr 5, 2022
Redis re-implemented in Rust.

rsedis Redis re-implemented in Rust. Why? To learn Rust. Use Cases rsedis does not rely on UNIX-specific features. Windows users can run it as a repla

Sebastian Waisbrot 1.6k Jan 6, 2023
Redis library for rust

redis-rs Redis-rs is a high level redis library for Rust. It provides convenient access to all Redis functionality through a very flexible but low-lev

Armin Ronacher 2.8k Jan 8, 2023
RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.

RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.

Qovery 145 Nov 23, 2022
A rust Key-Value store based on Redis.

Key-Value Store A Key-Value store that uses Redis to store data. Built using an async web framework in Rust with a full Command-Line interface and log

Miguel David Salcedo 0 Jan 14, 2022
[POC] Redis Module for TiKV

RedisTikvPoc [POC] Redis Module for TiKV This is a POC repository. This Redis Module will add branch new Redis commands to operate TiKV data. After bu

Rain Li 6 Jun 25, 2022
Incomplete Redis client and server implementation using Tokio - for learning purposes only

mini-redis mini-redis is an incomplete, idiomatic implementation of a Redis client and server built with Tokio. The intent of this project is to provi

Tokio 2.3k Jan 4, 2023
Basic Redis Protocol specification in Rust

Basic Redis Protocol specification in Rust

Bruno 1 Jan 20, 2022
Rewrite Redis in Rust for evaluation and learning.

Drill-Redis This library has been created for the purpose of evaluating Rust functionality and performance. As such, it has not been fully tested. The

Akira Kawahara 3 Oct 18, 2022
Redis compatible server framework for Rust

Redis compatible server framework for Rust Features Create a fast custom Redis compatible server in Rust Simple API. Support for pipelining and telnet

Josh Baker 61 Nov 12, 2022
A port of `java.util.*SummaryStatistics` as a Redis Module

RedisNumbersStats RedisNumbersStats is a Redis module that implements a Redis version of the Java Util *SummaryStatistics classes, such as DoubleSumma

Brian Sam-Bodden 4 Oct 4, 2022
A simplified version of a Redis server supporting SET/GET commands

This is a starting point for Rust solutions to the "Build Your Own Redis" Challenge. In this challenge, you'll build a toy Redis clone that's capable

Patrick Neilson 2 Nov 15, 2022
An intentionally-limited Rust implementation of the Redis server with no external dependencies.

lil-redis An intentionally-limited Rust implementation of the Redis server. lil redis is an accessible implementation of a very basic Redis server (wi

Miguel Piedrafita 37 Jan 1, 2023
Macros for redis-rs to serialize and deserialize structs automatically

redis-macros Simple macros and wrappers to redis-rs to automatically serialize and deserialize structs with serde. Installation To install it, simply

Daniel Grant 4 Feb 18, 2023
A cross-platform redis gui client

Redis-Manager A cross-platform redis gui client started developing with Tauri, React and Typescript in Vite. Get Started Prerequisites Install Node.js

Kurisu 11 Mar 31, 2023
📺 Netflix in Rust/ React-TS/ NextJS, Actix-Web, Async Apollo-GraphQl, Cassandra/ ScyllaDB, Async SQLx, Kafka, Redis, Tokio, Actix, Elasticsearch, Influxdb Iox, Tensorflow, AWS

Fullstack Movie Streaming Platform ?? Netflix in RUST/ NextJS, Actix-Web, Async Apollo-GraphQl, Cassandra/ ScyllaDB, Async SQLx, Spark, Kafka, Redis,

null 34 Apr 17, 2023
Lightweight async Redis client with connection pooling written in pure Rust and 100% memory safe

redi-rs (or redirs) redi-rs is a Lightweight Redis client with connection pooling written in Rust and 100% memory safe redi-rs is a Redis client writt

Oğuz Türkay 4 May 20, 2023
Simple and flexible queue implementation for Rust with support for multiple backends (Redis, RabbitMQ, SQS, etc.)

Omniqueue Omniqueue is an abstraction layer over queue backends for Rust. It includes support for RabbitMQ, Redis streams, and SQS out of the box. The

Svix 8 May 26, 2023
Sharded, concurrent mini redis that support http interface implemented in rust

Rudis A mini version of redis server that provides http interface implemented in Rust. The in-memorry kv-storage is sharded and concurrent safe. Inspi

Lorenzo Cao 43 May 30, 2023