From abba94e9c1fcc996f0d9db712dc8a9da548d7113 Mon Sep 17 00:00:00 2001 From: Andrei Bondarev Date: Wed, 21 Oct 2026 14:50:09 -0400 Subject: [PATCH] Document record-oriented points upsert in README Closes #15 --- README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7ec5346..96e761c 100644 --- a/README.md +++ b/README.md @@ -181,14 +181,43 @@ client.points.list( ) -# Get a single data object. +# Insert or update points. Either `points:` or `batch:` is required. client.points.upsert( collection_name: "string", # required - batch: {}, # required + points: [], # record-oriented: array of point hashes + batch: {}, # column-oriented: hash of parallel arrays wait: "boolean", ordering: "string" ) +# Record-oriented upsert: each point is a hash with its own id, vector and payload +client.points.upsert( + collection_name: "my_collection", + points: [ + {id: 1, vector: [0.9, 0.1, 0.1], payload: {color: "red"}}, + {id: 2, vector: [0.1, 0.9, 0.1], payload: {color: "green"}}, + {id: 3, vector: [0.1, 0.1, 0.9], payload: {color: "blue"}} + ] +) + +# Column-oriented (batch) upsert: ids, vectors and payloads are passed as parallel arrays +client.points.upsert( + collection_name: "my_collection", + batch: { + ids: [1, 2, 3], + vectors: [ + [0.9, 0.1, 0.1], + [0.1, 0.9, 0.1], + [0.1, 0.1, 0.9] + ], + payloads: [ + {color: "red"}, + {color: "green"}, + {color: "blue"} + ] + } +) + # Delete points client.points.delete( collection_name: "string", # required