https://github.com/makevoid/redijson
small library to use redis as JSON datastore for objects (serialized in json via Oj)
https://github.com/makevoid/redijson
db json lib library redis serializer
Last synced: 2 months ago
JSON representation
small library to use redis as JSON datastore for objects (serialized in json via Oj)
- Host: GitHub
- URL: https://github.com/makevoid/redijson
- Owner: makevoid
- Created: 2016-07-12T15:37:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-12T15:37:43.000Z (almost 10 years ago)
- Last Synced: 2025-05-14T01:59:06.530Z (about 1 year ago)
- Topics: db, json, lib, library, redis, serializer
- Language: Ruby
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# RediJson
small library to use redis + arbitrary objects (serialized in json)
# API / Usage
strings
```rb
R[:foo] # nil
R[:foo] = "bar"
R[:foo] # bar
```
and more!
```rb
R[:foo] = ["f", "o", "o"]
R[:foo] # ["f", "o", "o"]
```
As you can see, it serializes and deserializes JSON arrays, and...
```rb
R[:foo] = { foo: "bar" }
R[:foo] # { foo: "bar" }
```
...objects
and the implementation is really few lines of code, because it's composing two simple things, redis and json together!