D. The add_vector method was not called before update_vector
Solution
Step 1: Check vector existence before update
Updating a vector requires it to exist in the database first.
Step 2: Identify the error cause
Since 'v2' was never added, trying to update it causes an error.
Final Answer:
Vector 'v2' does not exist, so update fails -> Option A
Quick Check:
Update needs existing vector [OK]
Hint: Update only existing vectors, else error occurs [OK]
Common Mistakes:
Assuming update creates new vectors
Thinking data type mismatch causes error
Ignoring vector existence check
5. You want to delete vectors with similarity less than 0.5 to a query vector [0, 1, 0] from your vector database. Which sequence of operations correctly achieves this?
hard
A. Delete all vectors, then add only those with similarity >= 0.5
B. Search vectors with similarity < 0.5, then delete each by ID
C. Update vectors with similarity < 0.5 to zero vectors
D. Add new vectors with similarity >= 0.5, ignoring deletion
Solution
Step 1: Find vectors below similarity threshold
Use a search or filter operation to get IDs of vectors with similarity less than 0.5.
Step 2: Delete vectors by their IDs
Use the delete operation on each vector ID found to remove them from the database.
Final Answer:
Search vectors with similarity < 0.5, then delete each by ID -> Option B
Quick Check:
Filter then delete unwanted vectors [OK]
Hint: Filter vectors first, then delete by ID [OK]