Code Monkey home page Code Monkey logo

redis-rejson's Introduction

Redis ReJSON

Redis ReJSON (v4 Module - json manipulation) adapter for Ruby's Redis-rb - status: beta release

For a more complete implementation look at the newer https://rubygems.org/gems/rejson-rb

For an ORM build on top of redis-rjson-rb check out https://github.com/makevoid/redijson_models

Installation

Compile the ReJSON module - configure redis (you need v4) to load it ( loadmodule /etc/redis/modules/rejson/rejson.so in redis.conf )

Documentation of ReJSON - https://redislabsmodules.github.io/rejson/commands/#jsonstrlen


API:

R = Redis.new(db: 14)

R.json_get "foo" # => "bar"

R.json_set "foo", '"baz"' # => "OK"

R.json_get "foo", p: "." # every command comes with *path selectors* support (you can traverse json arrays and objects and set child values - . is the root)

R.json_type "foo" # => "string" # returns the ype of the value at the given key

R.json_str_len "foo" # => 3

else, check the specs ( https://github.com/makevoid/redis-rejson-rb/blob/master/spec/redis_rejson_spec.rb ) or the implementation itself (super simple atm)


Install

Add this gem to your gemfile:

gem "redis_rejson"

Then run bundle:

bundle

Enjoy :)

@makevoid

redis-rejson's People

Contributors

makevoid avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.