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
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
Fetched May 1, 2026