Replace an existing document

Contributors

PUT /persistence/v1/service/{serviceName}/collection/{collectionName}/account/{accountId}/{documentId}

Replaces an existing document in the specified collection for the specified database and account, with a specified new document. Returns the new document after replacement. If you need to update the field values of an existing document instead of replacing a document, use the PATCH method.

Parameters

Name Type In Required Description

serviceName

string

path

True

Participating external service name (name of the database).

collectionName

string

path

True

Persistence Service collection name (name of the table).

accountId

string

path

True

Persistence Service Cloud Manager account identifier for Tenancy service specification.

documentId

string

path

True

Document identifier displayed in object ID format.

X-Service-Request-Id

string

header

False

Request identifier used to tag the request for better supportability.

Request Body

Response

Status: 200, Edited persistence service document.
Name Type Required Description

_id

string

False

Persistence Service response document identifier. Auto generated and immutable.

document

PersistenceServiceRequest

False

(Opaque) Persistence service document as a key-value pair passed as a request.

Example response

{
  "_id": "60f51cf96bf74c1eec9be2cc"
}

Response

Status: 4xx, Error response
Name Type Required Description

errorCode

string

False

Error code

error

string

False

Error category

message

string

False

Error description message

Example response

{
  "errorCode": "P1002",
  "error": "api error",
  "message": "No document found of the specified documentId"
}

Response

Status: 5xx, Error response
Name Type Required Description

errorCode

string

False

Error code

error

string

False

Error category

message

string

False

Error description message

Example response

{
  "errorCode": "P1002",
  "error": "api error",
  "message": "No document found of the specified documentId"
}

Definitions

PersistenceServiceRequest

(Opaque) Persistence service document as a key-value pair passed as a request.