Data statements make point writes and maintenance operations inspectable before they reach Qdrant. Use a WHERE selector for mutations and a SHARD clause only when you are targeting a known shard key.
Upsert a complete point
Section titled “Upsert a complete point”Every value object requires exactly one case-insensitive id key: a duplicate key is rejected at parse time with QQL-PARSE-DUPLICATE-KEY, and a missing or non-point-ID value fails with QQL-VALIDATION-UPSERT-ID. A point can carry payload values, named dense vectors, sparse vectors, or multivectors, either as one unnamed vector or as an object of arbitrary named vectors.
| Vector shape | Value |
|---|---|
| Dense | [0.1, 0.2, 0.3] |
| Sparse | {indices: [1, 9], values: [0.4, 0.7]} |
| Multivector | [[0.1, 0.2], [0.3, 0.4]] |
UPSERT INTO docs VALUES { id: 1, title: 'QQL', text: 'Declarative vector retrieval', vector: { dense: [0.1, 0.2, 0.3], sparse: {indices: [1, 9], values: [0.4, 0.7]} }};When execution owns the embedding step, use USING or EMBED directives. The configured embedder resolves text before the operation is planned. Embedding specs are comma-separated, and each may name a MODEL, an ON FIELD source, and a VECTOR/INTO destination.
UPSERT INTO articles VALUES { id: 'article-1', title: 'Planning hybrid retrieval', body: 'Dense and sparse candidate generation'}EMBED body INTO dense_body USING DENSE, title INTO sparse_title USING SPARSE;
UPSERT INTO articles VALUES { id: 'article-2', title: 'Vector search', body: 'Semantic ranking'}USING DENSE MODEL 'all-MiniLM-L6-v2' ON FIELD body INTO dense_body, SPARSE MODEL 'qdrant/bm25' ON FIELD title INTO sparse_title;When ON FIELD is omitted, the default payload text field resolves in the deterministic priority order text, body, content, title, description, name, summary, document.
Update only what changed
Section titled “Update only what changed”There are two UPDATE forms. The payload form sets PAYLOAD under any WHERE filter:
UPDATE docs SET PAYLOAD = {status: 'reviewed'} WHERE <filter>;The vector form replaces a vector (optionally a named one) and targets exactly one point ID:
UPDATE docs SET VECTOR [dense] = [0.2, 0.3, 0.4] WHERE id = <point_id>;DELETE PAYLOAD, DELETE VECTOR, DELETE, and CLEAR PAYLOAD all require a WHERE selector so an empty script never mutates an entire collection by accident.
UPDATE docsSET PAYLOAD = {status: 'reviewed'}WHERE id = 42;
UPDATE docsSET VECTOR dense = [0.2, 0.3, 0.4]WHERE id = 42;
DELETE PAYLOAD draft_notesFROM docsWHERE status = 'published';
DELETE VECTOR denseFROM docsWHERE id = 42;
DELETE FROM docsWHERE status = 'expired';Browse and count
Section titled “Browse and count”SCROLL is for deterministic browsing, exports, and backfills. COUNT is for cardinality and accepts the same filter vocabulary.
SCROLL FROM docsWHERE status = 'published'WITH VECTOR falseLIMIT 100;
COUNT FROM docsWHERE status = 'published'WITH (exact = true);Use SCROLL ... AFTER point_id to continue from a cursor. Use COUNT without exact = true when an approximate answer is sufficient for a large collection.