Open
Description
Cluster connection classes should provide overrides for specific Redis Core and module commands to make them easy to use with OS Cluster API.
- Provide an abstraction that handles
FT.AGGREGATE
and executesFT.CURSOR READ
orFT.CURSOR DEL
on the correct node (on the node where FT.AGGREGATE was executed) automatically - Commands that should be executed on primaries with Round-robin load balancing/scheduling
- Commands that should be broadcasted to all primaries
- JSON.MGET:
import redis
from redis.commands.json.path import Path
r = redis.RedisCluster(host="localhost", port=16379)
doc = {
"a": 1,
"user":{
"name": "Paul John",
"email": "paul.john@example.com",
"a": 11,
"city": "London"
}
}
doc2 = {
"a": 2,
"user":{
"name": "Paul John",
"email": "paul.john@example.com",
"a": 22,
"city": "London"
}
}
rj = r.json()
rj.set("doc1", Path.root_path(), doc)
rj.set("doc2", Path.root_path(), doc2)
# Both mget commands should return all documents from cluster
print(rj.mget(["doc1", "doc2"], "$..a"))
print(rj.mget(["doc2", "doc1"], "$..a"))