https://$INDEX_NAME-$PINECONE_PROJECT_ID.svc.$PINECONE_ENVIRONMENT.pinecone.io
$INDEX_NAME
is the name you gave your index when you created it.$PINECONE_PROJECT_ID
is the Pinecone project id that your API key is associatedwhoami
operation below.$PINECONE_ENVIRONMENT
is the cloud region for your Pinecone project..whoami
to retrieve your project id.Fetch
operation looks up and returns records, by id, from an index. The returned records include the vector values and/or metadata.
Fetch records by their ids:
Upsert
operation writes records into an index.
("id-3", [3.3, 3.3])
:("id-3", [3.3, 3.3])
:Update
operation performs partial updates that allow changes to part of a record. Given an ID, we can update the vector value with the values
argument or update metadata with the set_metadata
argument.
Update
operation does not validate the existence of ids within an200 OK
("id-3", [3.0, 3.0], {"type": "doc", "genre": "drama"})
:
("id-3", [4.0, 2.0], {"type": "doc", "genre": "drama"})
. Values have been updated but the metadata is unchanged.
When updating metadata only specified fields will be modified. If a specified field does not exist, it is added.
Metadata updates apply only to fields passed to the set_metadata
("id-3", [4.0, 2.0], {"type": "doc", "genre": "drama"})
, use code like the following:
("id-3", [4.0, 2.0], {"type": "web", "genre": "drama", "new": true})
. The type
metadata field has been updated to web
, the new
property has been added with value true
, and the genre
property has been unchanged.
Both vector and metadata can be updated at once by including both values
and metadata arguments. To update both these parts of the "id-3"
record we write:
("id-3", [1.0, 2.0], {"type": "webdoc", "genre": "drama", "new": true})
.
Delete
operation deletes records from an index.
Alternatively, it can also delete all records from an index or namespace.
When deleting large numbers of records, limit the scope of delete operations to hundreds of records per operation.
Instead of deleting all records in an index, delete the index and recreate it.
namespace
parameter.