I have a requirement to call the patch method from a custom REST endpoint.
I've searched in the MarkLogic documentation and found this sample code -
function get(context, params) {
// return zero or more document nodes
};
function post(context, params, input) {
// return zero or more document nodes
};
function put(context, params, input) {
// return at most one document node
};
function deleteFunction(context, params) {
// return at most one document node
};
exports.GET = get;
exports.POST = post;
exports.PUT = put;
exports.DELETE = deleteFunction;
I currently use all of these JS extensions and they work just fine. I tried to make a patch function in the same fashion -
function patch(context, params, input) {
return;
}
exports.PATCH = patch;
When I call the patch method through my endpoint, I get a "405 Method Not Allowed". Is patch in this manner not allowed in MarkLogic, is that why it is not included in the sample code?
Thanks in advance.