JSON in ElastiCache for Redis Not working


When I test against my Redis cluster with the command 'JSON.SET', I get an error that says "unsupported command 'JSON.SET'". However, I did test against the cluster using the command 'SET', and that one worked properly. It seems that the cluster doesn't support JSON data types/ commands, but I can verify that the Redis cluster engine is 6.2.6.

Is this some configuration issue or is JSON commands no longer supported?




asked 2 years ago327 views
1 Answer

As checked link Supported Redis JSON commands. The command JSON.SET shoud be supported, and follow doucment:JSON.SET is working as expected. Could you double check your ElastiCacache redis version, and your redis client version.

The testing in my new created Elasticache redis cluster for reference.

$ redis-6.2.6/src/redis-cli --version
redis-cli 6.2.6
$ redis-6.2.6/src/redis-cli -h xxx.cache.amazonaws.com ping
$ redis-6.2.6/src/redis-cli -h xxx.cache.amazonaws.com info server | grep redis_version
$ redis-6.2.6/src/redis-cli -h xxx.amazonaws.com JSON.SET k1 . '{"firstName":"John","lastName":"Smith","age":27,"weight":135.25,"isAlive":true,"address":{"street":"21 2nd Street","city":"New York","state":"NY","zipcode":"10021-3100"},"phoneNumbers":[{"type":"home","number":"212 555-1234"},{"type":"office","number":"646 555-4567"}],"children":[],"spouse":null}'
$ redis-6.2.6/src/redis-cli -h xxx.cache.amazonaws.com JSON.GET k1 $.address.*
"[\"21 2nd Street\",\"New York\",\"NY\",\"10021-3100\"]"
profile pictureAWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions