MCPcopy
hub / github.com/msiemens/tinydb / updater

Method updater

tinydb/table.py:166–174  ·  view source on GitHub ↗
(table: dict)

Source from the content-addressed store, hash-verified

164
165 # Now, we update the table and add the document
166 def updater(table: dict):
167 if doc_id in table:
168 raise ValueError(f'Document with ID {str(doc_id)} '
169 f'already exists')
170
171 # By calling ``dict(document)`` we convert the data we got to a
172 # ``dict`` instance even if it was a different class that
173 # implemented the ``Mapping`` interface
174 table[doc_id] = dict(document)
175
176 # See below for details on ``Table._update``
177 self._update_table(updater)

Callers

nothing calls this directly

Calls 2

_get_next_idMethod · 0.95
popMethod · 0.80

Tested by

no test coverage detected