You can only upsert documents with the same structure as defined in your database.
Arguments
Document | Document[]
required
Response
'Success' on successful operation.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
await index.upsert({
id: "star-wars",
content: { title: "Star Wars", genre: "sci-fi" },
metadata: { year: 1977 }
});
await index.upsert([
{
id: "inception",
content: { title: "Inception", genre: "action" }
metadata: {
year: 2010,
},
},
{ ... },
]);
await index.upsert({
id: "star-wars",
content: {
title: "Star Wars: Episode IV - A New Hope",
genre: "sci-fi"
},
});
'Success' on successful operation.await index.upsert({
id: "star-wars",
content: { title: "Star Wars", genre: "sci-fi" },
metadata: { year: 1977 }
});
await index.upsert([
{
id: "inception",
content: { title: "Inception", genre: "action" }
metadata: {
year: 2010,
},
},
{ ... },
]);
await index.upsert({
id: "star-wars",
content: {
title: "Star Wars: Episode IV - A New Hope",
genre: "sci-fi"
},
});
Was this page helpful?