Dark Mode

Send a PATCH request to /api/rest/v2/namespaces/undefined/collections/undefined/undefined to replace data to the existing collection.All fields included will be changed.

PATCH Updates are upserts.If the document doesn't exist, it will be created.If it does exist, it will be updated with the new document data.

A GET request will show that the data has been replaced in the document:

It is also possible to update only part of a document. To partially update, senda PATCH request to /api/rest/v2/namespaces/undefined/collections/undefined/undefined/undefined .In this example, we want to change just the firstname of the document:

A GET will show that only the weights has been changed:

To partially update a sub-document, send a PATCH request to /api/rest/v2/namespaces/undefined/collections/undefined/undefined/undefined in the same manner as the last command, but including only sub-document information to change and the document-path of the sub-document. Include all fields that you wish to update.

and a GET will show that only the weights has been changed.