CroceIt / JReJSON

A Java client (wrapper) for Redis ReJSON

Home Page:https://oss.redislabs.com/rejson/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven Central License

JReJSON

A Java Client Library for ReJSON

Overview

This client provides access to ReJSON'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 ReJSON commands are supported at the moment.

Official Releases

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jrejson</artifactId>
      <version>1.1.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.1.1-SNAPSHOT</version>
    </dependency>
  </dependencies>

Build

1. Clone it: `git clone git@github.com:RedisLabs/JReJSON.git`
2. `cd JReJSON`
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

About

A Java client (wrapper) for Redis ReJSON

https://oss.redislabs.com/rejson/

License:BSD 2-Clause "Simplified" License


Languages

Language:Java 100.0%