Creates a new document or update an existing one

post

/_/baas-services/database/{project_id}/v1/setDocument

This service creates a new document in the specified collection or updates an existing one. For creating a new document, provide a collection path (odd-length array) and the data. For updating, provide a document path (even-length array), data, and options (e.g., merge: true to merge with existing data). Supports API versions 1 for data formats. For duality views, specify dv_name, data, and optional OID for updates. Returns the OID of the created or updated document. Requires authentication via Bearer token or AppKey. Use 'version' in requestBody for optimistic locking on updates.

Request

Path Parameters
Header Parameters
Back to Top

Response

200 Response

Returns OID of the new/updated document

401 Response

Authentication Failure

Default Response

Error
Back to Top