Hi Geert,

I try to patch document with this java call :

PatchHandle patch = ...
docManager.patch("/00000000-0000-0000-0000-000000000000.json", patch);

The document to update is :
{
    "ecm__id": "00000000-0000-0000-0000-000000000000",
    "ecm__racl": [ "Administrator", "Members" ],
    "dc__modified": "1970-01-01T00:00:00.000"
}

The first time, I want to insert { "ecm__minorVersion": 0 } with this call :
{
"pathlang": "xpath",
"patch": [{
"replace-insert": {
"select": "/node('ecm__minorVersion')",
"context": "/node('ecm__id')",
"position": "after",
"content": {
"ecm__minorVersion": 0
}
}
}]
}

The document is updated to :
{
"ecm__id": "00000000-0000-0000-0000-000000000000",
"ecm__minorVersion": 0,
"ecm__racl": ["Administrator", "Members"],
"dc__modified": "1970-01-01T00:00:00.000"
}

Then I want to update ecm__minorVersion to 1, with this call :
{
"pathlang": "xpath",
"patch": [{
"replace-insert": {
"select": "/node('ecm__minorVersion')",
"context": "/node('ecm__id')",
"position": "after",
"content": {
"ecm__minorVersion": 1
}
}
}]
}

The document is updated to :
{
"ecm__id": "00000000-0000-0000-0000-000000000000",
"ecm__minorVersion": {
"ecm__minorVersion": 1
},
"ecm__racl": ["Administrator", "Members"],
"dc__modified": "1970-01-01T00:00:00.000"
}
but I expect this :
{
"ecm__id": "00000000-0000-0000-0000-000000000000",
"ecm__minorVersion": 1,
"ecm__racl": ["Administrator", "Members"],
"dc__modified": "1970-01-01T00:00:00.000"
}

I have tried several patch requests, see below a non exhaustive list :
- put a 'parent' node at root -> same behaviour
- don't use node('...') in select path -> same behaviour
- don't use node('...') in context path -> same behaviour

Thanks for your help
Regards

Kevin Leturc *Software developer*
Twitter @kevinleturc
nuxeo.com <https://www.nuxeo.com>

[image: www.nuxeo.com - Content Management Platform] <http://www.nuxeo.com>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to