JSON in ElastiCache for Redis Not working

0

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?

References:

https://aws.amazon.com/blogs/database/unlocking-json-workloads-with-elasticache-and-memorydb/?sc_channel=EL&sc_campaign=Live_Streaming_2022_vid&sc_medium=YouTube&sc_content=a76oXjtQcK4&sc_detail=DATABASE&sc_country=US

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/json-gs.html

已提問 1 年前檢視次數 282 次
1 個回答
0

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
PONG
$ redis-6.2.6/src/redis-cli -h xxx.cache.amazonaws.com info server | grep redis_version
redis_version:6.2.6
$ 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}'
OK
$ 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
Jerry_K
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南