A Java Client Library for RedisJSON
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.
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.
<dependencies>
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>jrejson</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies> <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>1. Clone it: `git clone git@github.com:RedisJSON/JRedisJSON.git`
2. `cd JRedisJSON`
3. `mvn clean install -Dmaven.test.skip=true`
importredis.clients.jedis.Jedis;
importcom.redislabs.modules.rejson.JReJSON;
// First get a connectionJReJSONclient = newJReJSON("localhost", 6379);
// Setting a Redis key name _foo_ to the string _"bar"_, and reading it backclient.set("foo", "bar");
Strings0 = (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 interchangeableStrings1 = (String) client.get("foo", newPath("."));
Strings2 = (String) client.get("foo", Path.ROOT_PATH);
// Any Gson-able object can be set and updatedclient.set("obj", newObject()); // just an empty objectclient.set("obj", null, newPath(".zilch"));
Pathp = newPath(".whatevs");
client.set("obj", true, p);
client.set("obj", 42, p);
client.del("obj", p); // back to almost nothingPlease use this repository's issue tracker to submit issues and pull requests.