All Projects → RedisJSON → JRedisJSON

RedisJSON / JRedisJSON

Licence: BSD-2-Clause license
A Java client (wrapper) for Redis RedisJSON

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to JRedisJSON

redislabs-rejson
Redislabs RedisJson aka ReJson Client for PHP (PHP 7.3+)
Stars: ✭ 29 (-67.78%)
Mutual labels:  redisjson
redis-modules-sdk-ts
A Software development kit for easier connection and execution of Redis Modules commands.
Stars: ✭ 152 (+68.89%)
Mutual labels:  redisjson
redis-modules-java
Java client libraries for redis-modules https://redis.io/modules, based on Redisson. https://github.com/redisson/redisson
Stars: ✭ 57 (-36.67%)
Mutual labels:  redisjson

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].