Ankit Goel
Ankit Goel

Reputation: 173

Updating data in a XML file in marklogic using java api

Say I inserted XML file in MarkLogic datastore:

<Providers>
    <Provider>
        <UniqueId>1111</UniqueId>
        <name>John Doe</name>
        <Age>40</Age>
        <Country>MN</Country>
    </Provider>
    <Provider>
        <UniqueId>2222</UniqueId>
        <name>Johny Deep</name>
        <Age>51</Age>
        <Country>NY</Country>
    </Provider>
</Providers>

Now if I want to update the name to 'Jane Doe' where Unique Id is '1111', how can I achieve this using MarkLogic's java API?

Upvotes: 2

Views: 109

Answers (1)

Dave Cassel
Dave Cassel

Reputation: 8422

Goel, it sounds like you need the Patch operation. This allows you to specify a specific part of a document and add to, change, or delete it.

Upvotes: 2

Related Questions