当前位置:   article > 正文

JSON 的文档数据库 RedisJson 介绍_new jrejson

new jrejson

   redisJson官网地址:RedisJSON Tutorial | Redis Developer Hub

   RedisJSON 使 RediSearch 能够索引 JSON 文档,因此用户现在可以通过索引和查询内容来查找文档。这些组合模块为您提供了一个强大的、低延迟的、面向 JSON 的文档数据库!

先决条件:#

  • Redis 6.x 或更高版本
  • RediSearch 2.2 或更高版本
  • RediJSON 2.0 或更高版本

RedisJson发布官方性能报告,性能碾压ES和Mongo:

RedisJSON: Public Preview & Performance Benchmarking | Redis

 JRedisJSONRedisJSON: Public Preview & Performance Benchmarking | Redis的 Java 客户端库:

 该客户端提供对 RedisJSON 的 Redis API 的访问,并提供 Java 及其对象之间的来回序列化。该客户端目前支持核心 RedisJSON 命令。

  1. import redis.clients.jedis.Jedis;
  2. import com.redislabs.modules.rejson.JReJSON;
  3. // First get a connection
  4. JReJSON client = new JReJSON("localhost", 6379);
  5. // Setting a Redis key name _foo_ to the string _"bar"_, and reading it back
  6. client.set("foo", "bar");
  7. String s0 = (String) client.get("foo");
  8. // Omitting the path (usually) defaults to the root path, so the call above to
  9. // `get()` and the following ones // are basically interchangeable
  10. String s1 = (String) client.get("foo", new Path("."));
  11. String s2 = (String) client.get("foo", Path.ROOT_PATH);
  12. // Any Gson-able object can be set and updated
  13. client.set("obj", new Object()); // just an empty object
  14. client.set("obj", null, new Path(".zilch"));
  15. Path p = new Path(".whatevs");
  16. client.set("obj", true, p);
  17. client.set("obj", 42, p);
  18. client.del("obj", p); // back to almost nothing

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/590422
推荐阅读
相关标签
  

闽ICP备14008679号