Delete one document
Optionaloptions: Options<never, ThrowOnError, unknown>Delete a batch of documents
Deletes up to 2,048 documents. Each document is deleted on its own: a document that does not exist or whose precondition fails is not deleted, the others are, and the result of each document says which happened. Retrying with the same Idempotency-Key returns the same results.
Optionaloptions: Options<never, ThrowOnError, unknown>Get a document
Optionaloptions: Options<never, ThrowOnError, unknown>List documents
Optionaloptions: Options<never, ThrowOnError, unknown>Store one document
Stores one document of at most 1 GiB. Content that is valid UTF-8 and at most 100 MiB is
searchable. Any other content, such as an image or a larger file, is stored, listed, and served
by the document endpoints but is never matched by a search. The searchable field of a listing
reports which applies.
Optionaloptions: Options<never, ThrowOnError, unknown>Store a batch of documents
Stores up to 2,048 documents. Each document is stored on its own: a document whose precondition
fails is not stored, the others are, and the result of each document says which happened. Retrying
with the same Idempotency-Key returns the same results and stores any document an interrupted
attempt did not reach. Batch content is text carried as JSON strings, so every document stored this
way is searchable. Store binary content, or a document over 16 MiB, with the
single-document endpoint. The body may be sent with Content-Encoding: gzip; the service decodes it
before applying the limits below, and answers any other content encoding with 415
unsupported_content_encoding.
Optionaloptions: Options<never, ThrowOnError, unknown>Store any number of documents and return one result per document, in input order.
Text travels as NDJSON in batches of up to 2,048 documents and 16 MiB;
other content travels one document at a time. Every document gets path
(its key) and size metadata, which metadata can override. Each
document is stored on its own: one whose ifMatch or ifNoneMatch
condition fails is left unchanged and its result carries an error.
A failure after part of the documents were stored throws
PartialBatchError. With idempotencyKey (16 to 120 characters),
repeating the call with the same documents finishes it without storing
any document twice.
const results = await client.documents.putMany({
organization: "acme",
index: "docs",
documents: [{ key: "a.md", content: "# A", metadata: { kind: "guide" } }],
});
The documents of an index, reached as
client.documents.