Restore a Version of a Document
POST
/mongodb/collections/{collectionName}/documents/{documentId}/history/{auditId}/restore
Puts a document back to its state after (state=before: before) an audit record of a collection declared with audit (2.11.0): a replace through validation, behaviours and access rules (a versioned document gets a new version), or an insert when the document was deleted. Audited as restore. 400 for a collection without audit or a record without that state, 404 for a record of another document or a document outside the scope of the caller. Needs write and read.
Authorizations
httpAuth
Type
HTTP (bearer)
or
httpAuth1
Type
HTTP (basic)
or
apiKeyAuth
Type
API Key (header: X-AUTH-APIKEY)
Parameters
Path Parameters
collectionName*
The name of your MongoDb Collection
Type
Requiredstring
documentId*
DocumentId to restore
Type
Requiredstring
auditId*
The _id of the audit record (hex)
Type
Requiredstring
Query Parameters
state
after (default) or before the audited write
Type
string
Valid values
"after""before"Responses
application/json
JSON "wasAcknowledged": true, "upsertedIds": [ "string" ], "modifiedCount": 0, "matchedCount": 0
{
}
