





















Today, we’re announcing the addition of three bulk data operations to Pinecone Database: Update by Metadata, Delete by Metadata, and Fetch by Metadata. Instead of collecting record IDs first, you can target any subset of data using the same filter syntax you use in queries, making everyday tasks such as bulk updates, data purges, and selective fetches simpler and more efficient.
As data scales, metadata becomes essential for enabling functionality and maintaining performance. A recommendation isn’t very good if you can’t filter down to the specific data that’s relevant to the user, and the ability to filter your data accurately and efficiently is almost always reliant on metadata. A single attribute, such as , , or , can identify the exact corpus of relevant records precisely in a much easier way than collecting vector IDs. Update, delete, and fetch by metadata bring scalability to data management, allowing you to modify or retrieve millions of records accurately and efficiently using the metadata you already maintain.
The new operations leverage the same familiar filter syntax used in metadata-based queries. You define a filter based on your record’s metadata and pass it directly to the , , or methods.
Pinecone then performs the requested action on all records matching the filter, making bulk data operations incredibly easy and efficient, even if you’re modifying millions of records at once.
Filtering by metadata allows you to target subsets of data based on attributes. As your data scales, this becomes a very effective way to organize and manage your data. These new operations – update, delete, and fetch by metadata – are designed for common data management scenarios, including:
Integrating these new operations into your existing pipeline is simple. Since they use the same filter syntax as queries, there’s no new query language to learn.
Here’s a quick example of how to use update, delete, and fetch by metadata:
# pip install "pinecone"
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
# Get the unique host for an index
index = pc.Index(host="INDEX_HOST")
# Delete records from your index by metadata
index.delete(
namespace="example-namespace",
filter={
"genre": {"$eq": "documentary"}
}
)Note: update and fetch are not fully launched for General Availability yet and require direct API calls with specific version headers (and respectively). They don't yet have Python SDK support.
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"
# Update by metadata
curl "https://$INDEX_HOST/vectors/update" \
-H "Api-Key: $PINECONE_API_KEY" \
-H 'Content-Type: application/json' \
-H "X-Pinecone-API-Version: unstable" \
-d '{
"dry_run": true,
"namespace": "example-namespace",
"filter": {
"document_title": {"$eq": "Introduction to Vector Databases"}
},
"setMetadata": {
"author": "Del Klein"
}
}'
# Fetch by Metadata
curl -X POST "https://$INDEX_HOST/vectors/fetch_by_metadata" \
-H 'Api-Key: $PINECONE_API_KEY' \
-H 'Content-Type: application/json' \
-H "X-Pinecone-API-Version: 2025-10" \
-d '{
"namespace": "example-namespace",
"filter": {"rating": {"$lt": 5}},
"limit": 2
}'Update, delete, and fetch by metadata bring a new level of scalability and efficiency to your data management. It isn’t just a quality-of-life improvement; it’s a fundamental enhancement to how you can interact with and control your data at scale.
Delete by metadata is generally available, update by metadata is available in public preview, and fetch by metadata is available in early access (i.e., we will be adding additional functionality to fetch, including pagination, in the upcoming months).
Read the update, delete, and fetch by metadata documentation for more information on how to get started with each.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。