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

Method count

tinydb/table.py:628–635  ·  view source on GitHub ↗

Count the documents matching a query. :param cond: the condition use

(self, cond: QueryLike)

Source from the content-addressed store, hash-verified

626 self._next_id = None
627
628 def count(self, cond: QueryLike) -> int:
629 """
630 Count the documents matching a query.
631
632 :param cond: the condition use
633 """
634
635 return len(self.search(cond))
636
637 def clear_cache(self) -> None:
638 """

Callers 15

test_multiple_tablesFunction · 0.80
test_query_cacheFunction · 0.80
test_zero_cache_sizeFunction · 0.80
test_query_cache_sizeFunction · 0.80
test_insertFunction · 0.80
test_insert_multipleFunction · 0.80
test_removeFunction · 0.80
test_updateFunction · 0.80
test_update_allFunction · 0.80

Calls 1

searchMethod · 0.95

Tested by 15

test_multiple_tablesFunction · 0.64
test_query_cacheFunction · 0.64
test_zero_cache_sizeFunction · 0.64
test_query_cache_sizeFunction · 0.64
test_insertFunction · 0.64
test_insert_multipleFunction · 0.64
test_removeFunction · 0.64
test_updateFunction · 0.64
test_update_allFunction · 0.64