关于redis:Redis的底层类型之json

6次阅读

共计 2153 个字符,预计需要花费 6 分钟才能阅读完成。

对于 redisjson

The JSON capability of Redis Stack provides JavaScript Object Notation (JSON) support for Redis. 能够看到 redis json 是输出 RedisStack 的一部分。

那么 RedisStack 又是什么呢?

Redis Stack is the best starting point for working with Redis. We’ve bundled together the best of the technology that we have to offer into an easy-to-use package. Redis Stack extends the core features of Redis OSS and provides a complete developer experience for debugging and more.

RedisStack 是应用 Redis 的最佳终点。咱们曾经把咱们必须提供的最好的技术捆绑在一起,造成一个易于应用的软件包。Redis Stack 扩大了 Redis OSS 的外围个性,并为调试等提供了残缺的开发人员体验。

Redis Stack 将以下性能捆绑到 Redis 中:JSON、搜寻和查问、工夫序列和概率性。

Redis Stack packaging
There are two distinct Redis Stack packages to choose from:
有两种不同的 Redis Stack 包可供选择:

Redis Stack Server: This package contains Redis OSS and module extensions only. It does not contain RedisInsight, the developer desktop application. This package is best for production deployment and is intended to be a drop-in replacement (for example, if you’re already deploying Redis OSS as a cache). You can still download RedisInsight separately.

Redis Stack Server:该包仅蕴含 Redis OSS 和模块扩大。它不蕴含 RedisInsight 开发人员桌面应用程序。这个包最适宜生产部署,并旨在作为替代品(例如,如果您曾经将 Redis OSS 部署为缓存)。您依然能够独自下载 RedisInsight。

Redis Stack: This package contains everything a developer needs in a single bundle. This includes Redis Stack Server (Redis OSS and module extensions) along with the RedisInsight desktop application (or part of the docker container). If you want to create an application locally and explore how it interacts with Redis, this is the package for you.

Redis Stack:这个包蕴含开发人员在一个独自的捆绑包中所需的所有。这包含 Redis Stack Server(Redis OSS 和模块扩大)以及 RedisInsight 桌面应用程序(或 Docker 容器的一部分)。如果您想在本地创立一个应用程序并摸索它与 Redis 的交互方式,这个包适宜您。

如何装置 redis-statck

version: "3.7"

services:
    redis:
      image: redis/redis-stack-server:latest
      container_name: redisstack
      hostname: redisstack
      restart: always
      ports:
        - "16379:6379"
      volumes:
        # - ./conf/redis.conf:/usr/local/etc/redis/redis.conf
        - ./data:/data
        - ./logs:/logs
      command:
        redis-stack-server --requirepass aimore@123456
      networks:
        - default

networks:
  default:
    external:
      name: aimore

命令

  • JSON.SET
JSON.SET key path value [NX | XX]

JSON.SET doc $ '{"a":2}'
JSON.SET doc $.a '3'

JSET.SET returns a simple string reply: OK if executed correctly or nil if the specified NX or XX conditions were not met.

  • JSON.GET
JSON.GET key [INDENT indent] [NEWLINE newline] [SPACE space] [path
  [path ...]]

Return the value at path in JSON serialized form

  • JSON.DEL
JSON.DEL key [path]
正文完
 0