如果是最後一項,我試圖在花括號後面沒有逗號。如何在MarkLogic的正確位置生成JSON?
for $row in /md:row
let $test := $row/md:test/text()
let $last := $row/*[fn:position() = fn:last()]
return (
'{
"test": {
"type": "test",
"test": [',$testa,',',$testb,']
}
}',
if($last)
then ''
else (',')
)
感謝您通知有關問題。 – Jon