Usage

Utility functions for Orama

Learn how to use utility functions in Orama.

Orama 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 Orama database by its ID.

import { getByID } from "@orama/orama";

const thePrestige = await getByID(movieDB, "tt0482571");

// Returns the original, full document

count

count is a function that allows you to retrieve the number of documents in a Orama database.

import { count } from "@orama/orama";

const docNumber = await count(movieDB);

// Returns the number of documents in the database

Last updated on

On this page