MarkLogic中是否有修补程序的JavaScript资源扩展?

MarkLogic中是否有修补程序的JavaScript资源扩展?,marklogic,http-patch,Marklogic,Http Patch,我需要从自定义REST端点调用patch方法 我在MarkLogic文档中搜索了一下,找到了这个示例代码- 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)

我需要从自定义REST端点调用patch方法

我在MarkLogic文档中搜索了一下,找到了这个示例代码-

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; 
我目前使用所有这些JS扩展,它们工作得很好。我试着用同样的方式制作一个补丁函数-

function patch(context, params, input) {
 return;
}

exports.PATCH = patch;
当我通过端点调用patch方法时,得到一个“405 method Not Allowed”。MarkLogic中是否不允许使用这种方式的修补程序,这就是示例代码中不包含该修补程序的原因吗


提前感谢。

资源服务扩展机制不支持修补程序方法

用于补丁服务的最佳动词可能是POST

如果修补程序服务正在修改文档,则实现可以使用
xdmp.node(Insert*| Replace | Delete)
函数,例如

另一种选择是建立一个单独的appserver,在声明式重写器中为补丁提供规则,或者在命令式重写器中使用该方法。见:


希望这能有所帮助,MarkLogic自己的REST扩展机制可能不支持补丁方法,但肯定支持

像这样

declare
  %rest:PATCH
  %rest:path("/my/uri/how/i/want/it")
  %output:method("json")
function my-patch-request() {
  object-node {
    "my-key" : "my-value"
  }
};