I have an MarkLogic XQuery eval call that returns lists of strings. I use the code below to process the results. I have another call that returns a list of Json Documents, but I don't see how to get EvalResult to provide me with a JsonDocument document. How to change the below code to handle Json Documents?
public static ArrayList<String> getStringList(DatabaseClient client, String query)
{
ArrayList<String> strings = new ArrayList<String>();
ServerEvaluationCall eval = client.newServerEval();
EvalResultIterator eri = eval.xquery(query).eval();
while (eri.hasNext())
{
EvalResult er = eri.next();
String s = er.getString();
strings.add(s);
}
return strings;
}
source
share