简体   繁体   中英

Bulk Patching of documents in Marklogic database using java client api

I have several json documents like below :-

{ status : TO_BE_REPORTED, date : 2017/11/11 .... }

I want to update or patch the documents by only replacing the status field value from TO_BE_REPORTED to REPORTED and I want to do the bulk update as I have thousands of documents with me. I am using the DocumentPatchBuilder but it doesn't support bulk updates.

On the other hand i can see that Marklogic has few concepts of doing a Bulk write using docManager.newWriteSet and then adding documents to it but it doesn't support document patching?

Are there other things that i can try?

I'd recommend reading up on the Data Movement SDK . It should contain various code snippets on how to do various updates.

HTH!

CoRB2 is a community built tool intended to do bulk updates. You provide a URI module that identifies which documents are to be updated and a processing module to specify what changes are to be made. The modules can be written in either XQuery or JavaScript (I believe that's right; it has always supported XQuery and I think they added JS some time ago). It doesn't use the Java Client API, but should address your need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM