Closed pepoluan closed 2 years ago
Hey,
yes, data
should be what you're looking for. https://aiocouch.readthedocs.io/en/stable/document.html#aiocouch.document.Document.data
Be vary though, the documentation has some rough edges. In particular, data
returns None
if fetch()
wasn't awaited, or the received data denoted a deleted document.
Is there an "official" way to convert a
Document
instance to a normaldict
?The reason is that we are only interested in reading & manipulating the data, and because
Document
implemented the.copy()
method we got some surprise treating an instance ofDocument
as a dict.Edit: After perusing the source, it seems that
.data
provides access to the internal dict that underliesDocument
. Do I get this correctly? It's it safe to grab.data
and treats it like a dict?