Skip to content

Instantly share code, notes, and snippets.

@dmcassel
Created June 30, 2014 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmcassel/e892bfe8f016eea34045 to your computer and use it in GitHub Desktop.
Save dmcassel/e892bfe8f016eea34045 to your computer and use it in GitHub Desktop.
xquery version "1.0-ml";
module namespace trns = "http://marklogic.com/transform/to-json";
import module namespace json="http://marklogic.com/xdmp/json" at "/MarkLogic/json/json.xqy";
declare function trns:transform(
$content as map:map,
$context as map:map
) as map:map*
{
map:put(
$content,
'value',
document { json:transform-from-json(map:get($content, 'value')) }
),
$content
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment