MyGit

v9.3.0

redis/go-redis

版本发布时间: 2023-10-31 23:04:50

redis/go-redis最新发布版本:v9.6.1(2024-07-25 16:09:58)

What's new?

JSON support

We are continuing to add support for more Redis data types in Go-Redis. Today, we are happy to announce support for JSON. JSON is a Redis data structure for storing, querying, and manipulating a single JSON document.

With a JSON key in Redis, you can:

The following example demonstrate how to get started with JSON in Go-Redis:

var ctx = context.Background()
client := redis.NewClient(&redis.Options{
	Addr: "localhost:6379",
})

type Bicycle struct {
	Brand       string
	Model       string
	Price       int
}

bicycle := Bicycle{
	Brand: "Velorim",
	Model: "Jigger",
	Price: 270,
}

_, err := client.JSONSet(ctx, "bicycle:1", "$", bicycle).Result()
if err != nil {
	panic(err)
}

res, err := client.JSONGet(ctx, "bicycle:1", ".Model").Result()
if err != nil {
	panic(err)
}
fmt.Println("bicycle:1 model is", res)

Learn more about JSON support in Redis

Other notable improvements

🐛 Bug Fixes

🧰 Maintenance

Contributors

We'd like to thank all the contributors who worked on this release!

@Sovietaced, @chayim, @chenjie199234, @cyningsun, @dependabot, @dependabot[bot], @fred84, @nic-gibson, @ofekshenawa, @peczenyj, @sethrylan, @snaffi, @tzq0301 and @vmihailenco

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-10-31发行的版本