if you are using an API, just create an array of objects and add them as a parameter it should look something like this in the end:
"data": {
"vectors": [
{
"values": [
1
],
"metadata": {
"newKey": "New Value",
"newKey-1": "New Value"
},
"id": "1"
},
{
"values": [
2
],
"metadata": {
"newKey": "New Value 2",
"newKey-1": "New Value 2"
},
"id": "2"
},
// Here just continue adding new vectors
]
}
Python code:
upsert_vectors= []
# vec_id- some string
# embedding - array of floats
# metadata - dict like { "newKey": "New Value", "newKey-1": "New Value" }
upsert_vectors.append((vec_id, embedding, metadata)) # do this to as many as you have
index.upsert(upsert_vectors, namespace="name-space")
For more the documentation have a few examples as well: Insert data