@bodil/bdb
    Preparing search index...

    Function index

    • Create an index.

      This function takes a document type as its type argument, and returns an object with a selection of IndexConstructors which allow you to create an index for the given document type.

      Type Parameters

      • Document extends object

      Returns IndexConstructor<Document>

      type Document = { id: string; timestamp: Temporal.Instant };
      const idIndex = index<Document>().key("id");
      const timeIndex = index<Document>().time("timestamp");