GithubHelp home page GithubHelp logo

mi1688 / jredisjson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redisjson/jredisjson

1.0 0.0 0.0 1.41 MB

A Java client (wrapper) for Redis RedisJSON

Home Page: https://redisjson.io

License: BSD 2-Clause "Simplified" License

Java 100.00%

jredisjson's Introduction

license CircleCI GitHub issues Maven Central Javadocs Codecov

Language grade: Java Known Vulnerabilities

JRedisJSON

Forum Discord

A Java Client Library for RedisJSON

Deprecation notice

As of Jedis 4.0.0 this library is deprecated. It's features have been merged into Jedis. Please either install it from maven or the repo.

Overview

This client provides access to RedisJSON's Redis API, and provides back-and-forth serialization between Java's and its objects.

This project is currently WIP and the interface may change. Also note that only the core RedisJSON commands are supported at the moment.

Official Releases

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jrejson</artifactId>
      <version>1.4.0</version>
    </dependency>
  </dependencies>

Snapshots

  <repositories>
    <repository>
      <id>snapshots-repo</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

and

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jrejson</artifactId>
      <version>1.5.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

Build

1. Clone it: `git clone [email protected]:RedisJSON/JRedisJSON.git`
2. `cd JRedisJSON`
3. `mvn clean install -Dmaven.test.skip=true`

Usage example

import redis.clients.jedis.Jedis;
import com.redislabs.modules.rejson.JReJSON;

// First get a connection
JReJSON client = new JReJSON("localhost", 6379);

// Setting a Redis key name _foo_ to the string _"bar"_, and reading it back
client.set("foo", "bar");
String s0 = (String) client.get("foo");

// Omitting the path (usually) defaults to the root path, so the call above to
// `get()` and the following ones // are basically interchangeable
String s1 = (String) client.get("foo", new Path("."));
String s2 = (String) client.get("foo", Path.ROOT_PATH);

// Any Gson-able object can be set and updated
client.set("obj", new Object());             // just an empty object
client.set("obj", null, new Path(".zilch"));
Path p = new Path(".whatevs");
client.set("obj", true, p);
client.set("obj", 42, p);
client.del("obj", p);                        // back to almost nothing

Contributing

Please use this repository's issue tracker to submit issues and pull requests.

License

BSD 2-Clause License

jredisjson's People

Contributors

gkorland avatar snyk-bot avatar itamarhaber avatar sazzad16 avatar chayim avatar dragnot avatar bsbodden avatar dependabot[bot] avatar

Stargazers

dami 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.