Used to retrieve documents by their IDs.
Arguments
IDs
string[] | number[]
required
The IDs of the documents you want to fetch.
OR
The IDs of the documents you want to fetch.
An ID prefix to match document IDs.
Response
This field is null
if no document with the specified ID is found.
The ID of the resulting document.
await index.fetch({ ids: ["star-wars", "inception"] });
/*
[
{
id: "star-wars",
content: { ... },
metadata: { ... }
},
{
id: "inception",
content: { ... },
metadata: { ... }
}
]
*/