Skip to main content
Used to add new vectors or update an existing vector.
You can only upsert vectors with same dimension count(size) as your index.

Arguments

Payload
Vector | Vector[]
required

Response

'Success' on successful operation.
await index.upsert({
  id: "1234",
  vector: [0.1, 0.2, 0.3, 0.4, 0.5],
  metadata: {
    title: "Lord of The Rings",
    genre: "drama",
    category: "classic",
  },
});
await index.upsert([
  {
    id: "6789",
    vector: [0.6, 0.7, 0.8, 0.9, 0.9],
  },
  {
    id: "1234",
    vector: [0.1, 0.2, 0.3, 0.4, 0.5],
    metadata: {
      title: "Lord of The Rings",
      genre: "drama",
      category: "classic",
    },
  },
]);
await index.upsert({
	id: "1234",
	vector: [0.1, 0.2, 0.3, 0.4, 0.5]
	metadata: {
		title: "Redis"
	}
})

await index.upsert({
	id: "1234",
	metadata: {
		title: "QStash"
	}
})