Reputation: 2740
I want to use redis command line (using redis-cli) to store json values. This is what I do
redis 127.0.0.1:6379> set test '{"a":"b"}'
This command fails with message :
Invalid argument(s)
I don't have problem with setting values that don't contain double quotes. What is the correct way to escape double quotes?
Upvotes: 35
Views: 29110
Reputation: 81
We can use single quotes for storing the JSON value:
set name '{"a":"b"}'
Run get query like: get name
output : {"a":"b"}
Upvotes: 8