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 Document = { id: string; timestamp: Temporal.Instant };const idIndex = index<Document>().key("id");const timeIndex = index<Document>().time("timestamp"); Copy
type Document = { id: string; timestamp: Temporal.Instant };const idIndex = index<Document>().key("id");const timeIndex = index<Document>().time("timestamp");
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.