MCPcopy
hub / github.com/redis/redis-py / Document

Class Document

redis/commands/search/document.py:1–17  ·  view source on GitHub ↗

Represents a single document in a result set

Source from the content-addressed store, hash-verified

1class Document:
2 """
3 Represents a single document in a result set
4 """
5
6 def __init__(self, id, payload=None, **fields):
7 self.id = id
8 self.payload = payload
9 for k, v in fields.items():
10 setattr(self, k, v)
11
12 def __repr__(self):
13 return f"Document {self.__dict__}"
14
15 def __getitem__(self, item):
16 value = getattr(self, item)
17 return value

Callers 4

load_documentMethod · 0.85
load_documentMethod · 0.85
__init__Method · 0.85
from_resp3Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected