I have a question regarding documents patching in MarkLogic databse using REST API.
I have a service written in .NET Core and I use MarkLogic as my store for the data. In my case I must patch thousands of documents and if it is possible, I don't want to make a thousands of requests. To be more specific - I must add a few properties in certain part of JSON document. Following this guides:
I understand, that using PATCH request we can only update one document at a time so I tried to make a POST like this (for now only with one example patch operation)
POST http://host:port/v1/documents HTTP/1.1
Authorization: Basic autorization
Content-Type: multipart/mixed; boundary=BOUNDARY
--BOUNDARY
Content-Type: application/json
Content-Disposition: category=content; attachment; filename=/documents/first_document_to_update.json
X-HTTP-Method-Override: PATCH
{
"patch": [
{
<patch property insert definition>
}
]
}
--BOUNDARY--
but it just created a document with a content from BOUNDARY at uri from Content-Disposition header. I also tried to use X-HTTP-Method-Override header directly on a POST request, it didn't work out either - I got
{
"errorResponse": {
"statusCode": 400,
"status": "Bad Request",
"messageCode": "REST-REQUIREDPARAM",
"message": "REST-REQUIREDPARAM: (err:FOER0000) Required parameter: uri"
}
}
So my conclusion is that it is not possible to make a patch update of multiple documents using one POST request, am I right? Or I am missing something important?
MarkLogic version: 10