upsert() takes either an array of items or parallel arrays:
Parameters
Shape 1: items
Each item can contain:
Strings in
contents are stored as-is; bytes are base64-encoded first. get() always returns contents as a string, so bytes come back as their base64 text.
Shape 2: parallel arrays
Returns
Promise<UpsertResponse> with status and message, e.g. { status: 'success', message: 'Upserted 2 vectors' }. An empty items array returns { status: 'success', message: 'No items to upsert' } without calling the service.
Exceptions
CyborgDBValidationError
CyborgDBValidationError
- The input matches neither shape, arrays differ in length, or an
itemsornumber[][]vector contains a non-finite number. Thrown before any request is sent.Float32Arrayinput isn’t checked. - The service rejects the items (HTTP
400), for example a vector with the wrong dimension.
CyborgDBAuthenticationError
CyborgDBAuthenticationError
The
indexKey or apiKey is invalid, or a read-only user key is used (HTTP 401/403).CyborgDBServiceError
CyborgDBServiceError
The service returns
5xx.Example Usage
Items
Parallel arrays
Float32Array (binary)
Float32Array when the vectors already come from a model or buffer in that form.