await index.fetch({ ids: ["star-wars", "inception"] });
/*
[
  {
    id: "star-wars",
    content: { ... },
    metadata: { ... }
  },
  {
    id: "inception",
    content: { ... },
    metadata: { ... }
  }
]
*/
Used to retrieve documents by their IDs.

Arguments

IDs
string[] | number[]
required
The IDs of the documents you want to fetch.
OR
FetchPayload
object
required

Response

FetchResult[]
Document[]
required
This field is null if no document with the specified ID is found.
await index.fetch({ ids: ["star-wars", "inception"] });
/*
[
  {
    id: "star-wars",
    content: { ... },
    metadata: { ... }
  },
  {
    id: "inception",
    content: { ... },
    metadata: { ... }
  }
]
*/