redis-om-python
redis-om-python copied to clipboard
Field projection using JSON Path expressions
Hello,
Sometimes an object is huge and only want to return from Redis subset of the data
https://oss.redis.com/redisjson/indexing_JSON/#field-projection
For now, I am using the low level
redis = self.db()
args = [
"FT.SEARCH",
Model.Meta.index_name,
f"(@field_1:{{{self.pk}}}) (@field_2:{{value_2}})",
"RETURN",
"2",
"$.field_3",
"$.field_4",
]
redis.execute_command(*args)