Skip to content

Commit aebd764

Browse files
committed
Fixed issue #2598 - make Document class subscriptable
1 parent 6c708c2 commit aebd764

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

redis/commands/search/document.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ def __init__(self, id, payload=None, **fields):
1111

1212
def __repr__(self):
1313
return f"Document {self.__dict__}"
14+
15+
def __getitem__(self, item):
16+
return self.Document[item]

0 commit comments

Comments
 (0)