I am new to json so need a little help I need to get json value of each property, so when I ran the below code, I get the json in text.
let $doc :=
for $sResult in ($result/search:result)
let $uri := fn:data($sResult/@uri)
let $docElements := $sResult/search:extracted
return xdmp:from-json-string($docElements/text())
return $doc
Output in text format:
[{"title":"xxxxxxxxx"}, {"species":"Animals"}]
[{"title":"yyyyyyyyy"}, {"species":"Animals"}]
So I want to get something like $docElements/title/text()
, so that I get the value of title json property to do some string operations and then put them back in json object to get the desired output.
So, not sure how to do the same.