# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index = pc.Index("docs-example")
index.update(
id="id-3",
values=[4.0, 2.0],
set_metadata={"genre": "comedy"},
namespace="example-namespace"
)
{}
Update a vector
The update operation updates a vector in a namespace. If a value is included, it will overwrite the previous value. If a set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value.
For guidance and examples, see Update data.
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index = pc.Index("docs-example")
index.update(
id="id-3",
values=[4.0, 2.0],
set_metadata={"genre": "comedy"},
namespace="example-namespace"
)
{}
Documentation Index
Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt
Use this file to discover all available pages before exploring further.
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index = pc.Index("docs-example")
index.update(
id="id-3",
values=[4.0, 2.0],
set_metadata={"genre": "comedy"},
namespace="example-namespace"
)
{}
Authorizations
Body
The request for the update operation.
Vector's unique id.
1 - 512"example-vector-1"
Vector data.
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.
Show child attributes
Show child attributes
Metadata to set for the vector.
{ "genre": "documentary", "year": 2019 }The namespace containing the vector to update.
"example-namespace"
Response
A successful response.
The response for the update operation.
Was this page helpful?