Redis › RedisJSON
What is RedisJSON, and how does it improve working with JSON data compared to storing it as a plain string?
BeginnerAnswer
RedisJSON is a module that adds native support for storing, retrieving, and modifying JSON documents directly within Redis, letting you access and update specific fields deep within a document without needing to retrieve, parse, modify, and rewrite the entire JSON string, which is required when JSON is simply stored as a plain text value.
JSON.SET user:100 $ '{"name":"Sarah","age":29,"address":{"city":"Boston"}}'
JSON.GET user:100 $.address.cityReal-world example A user profile system stores complete user documents as JSON using RedisJSON, letting the application directly update just a user's city field without needing to retrieve and rewrite the entire profile document.