Usage
Utility functions for ZBSearch
Learn how to use utility functions in ZBSearch.
ZBSearch exposes a few utility functions that can be useful when working with the search results.
getByID
getByID is a function that allows you to retrieve a document from a ZBSearch database by its ID.
import { getByID } from "zbsearch";
const thePrestige = await getByID(movieDB, "tt0482571");
// Returns the original, full documentcount
count is a function that allows you to retrieve the number of documents in a ZBSearch database.
import { count } from "zbsearch";
const docNumber = await count(movieDB);
// Returns the number of documents in the database