Database / Qdrant Vector DB Interview questions
How do you insert/upsert points into a collection?
Points are added or updated in Qdrant using the upsert operation, which either inserts a new point if its ID doesn't already exist, or overwrites the existing point's vector and payload if it does — the same call handles both cases.
client.upsert( collection_name="documents", points=[ models.PointStruct( id=1, vector=[0.1, 0.2, 0.3, 0.4], payload={"title": "Intro to Qdrant", "category": "tutorial"}, ), models.PointStruct( id=2, vector=[0.5, 0.6, 0.7, 0.8], payload={"title": "Advanced Filtering", "category": "guide"}, ), ], )
Uploading points one at a time is discouraged for anything beyond trivial volumes, since each call carries request overhead; for bulk loading, batching many points into a single upsert call (or using a dedicated bulk-upload helper method some client libraries provide) is significantly more efficient.
Because upsert is idempotent by ID, re-running the same upload with unchanged data is safe and simply results in the same final state, which is a useful property for retry logic or re-syncing a dataset without needing to first check what already exists.
More Related questions...