IniziaInizia gratis

Updating vector metadata

This time, you'll practice updating vectors in the datacamp-index Pinecone index with new metadata. You'll again verify these changes were successful by retrieving the vector and checking its metadata.

Questo esercizio fa parte del corso

Vector Databases for Embeddings with Pinecone

Visualizza il corso

Istruzioni dell'esercizio

  • Initialize the Pinecone connection with your API key.
  • Update the vector with ID "7" with new metadata: "genre" of "thriller" and "year" of 2024.
  • Fetch the vector to check if the metadata has been updated.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Initialize the Pinecone client with your API key
pc = Pinecone(api_key="____")

index = pc.Index('datacamp-index')

# Update the metadata of vector ID 7
____

# Fetch vector ID 7
fetched_vector = ____
print(fetched_vector)
Modifica ed esegui il codice