pub fn count_collection_docs_store(
collection: &CollectionKey,
) -> Result<usize, String>
Expand description
Count the number of documents in a collection’s store.
This function retrieves the state rule for the specified collection and counts the documents
based on the memory type (Heap or Stable). It returns the count as a Result
with Ok(usize)
on success, or an error message as Err(String)
if an issue occurs during counting.
§Parameters
collection
: A reference to theCollectionKey
representing the collection to count documents in.
§Returns
Ok(usize)
: The count of documents in the collection.Err(String)
: An error message if counting fails.
This function provides a convenient way to determine the number of documents in a Juno collection’s store.