Hi Pragya,

You can try out the below mentioned code:

import module namespace json = "http://marklogic.com/xdmp/json"; at
"/MarkLogic/json/json.xqy";
for $xmls in fn:collection('MarcVideo')[1 to 10]
let $xmls1 := xdmp:quote($xmls)
let $xmls2 := xdmp:unquote($xmls1)
let $uri := base-uri($xmls)
let $token := tokenize($uri,'/')[last()]
let $custom :=
  let $config := json:config("custom")
  let $_ := map:put( $config, "whitespace", "ignore" )
  let $_ := map:put( $config, "array-element-names", "Video" )
  return $config

let $json :=  json:transform-to-json($xmls,$custom)

return

  (

     xdmp:save(concat('D:\test\', $token), $json)

  )


Regards

Dharmendra Kumar Singh
On Mon, Jan 2, 2017 at 12:28 PM, Kapoor, Pragya <[email protected]>
wrote:

> Hi,
>
>
> Requirement:
>
> 1. Convert xmls stored in marklogic db to json then save them to file
> system.
>
> 2. Store in-memory json  in ML DB
>
>
> How can we achieve the same?
>
>
> Thanks
>
> Pragya
> "This e-mail and any attachments transmitted with it are for the sole use
> of the intended recipient(s) and may contain confidential , proprietary or
> privileged information. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message. Any unauthorized review, use, disclosure, dissemination,
> forwarding, printing or copying of this e-mail or any action taken in
> reliance on this e-mail is strictly prohibited and may be unlawful."
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to