Hi Erik Hennum

If I go with PUT, it is replacing the entire document,which is not
acceptable.

How to add json document+pdf in one document ?

I used below approach
1. Added a PDF as a separate document and tried adding that uri as part of
PATCH to referring document, but getting message 204

curl  --basic --user  user:pwd -X POST -d@./patch.json \
 -i -H "Content-type: application/json" \
  -H "X-HTTP-Method-Override: PATCH" \
  'http://localbox:9004/LATEST/documents?uri=/test/LW88899'

and patch.json is

{"pathlang": "jsonpath",

  "patch": [

    {

      "insert": {

        "context": "$.parent.childe",

        "position": "last-child",

        "content": {

          "image": "/example/scdhhs_fm_300.pdf"

        }

      }

    }

  ]

}

Message:
Response:
HTTP/1.1 204 Unchanged
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to