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

Method __len__

tinydb/database.py:260–268  ·  view source on GitHub ↗

Get the total number of documents in the default table. >>> db = TinyDB('db.json') >>> len(db) 0

(self)

Source from the content-addressed store, hash-verified

258 # not handled by __getattr__ so we need to forward them manually here
259
260 def __len__(self):
261 """
262 Get the total number of documents in the default table.
263
264 >>> db = TinyDB('db.json')
265 >>> len(db)
266 0
267 """
268 return len(self.table(self.default_table_name))
269
270 def __iter__(self) -> Iterator[Document]:
271 """

Callers 1

__repr__Method · 0.95

Calls 1

tableMethod · 0.95

Tested by

no test coverage detected