try {
List<ODocument> docs = DocumentService.getDocuments(collection, params);
String s = JSONFormats.prepareDocToJson(docs, JSONFormats.Formats.DOCUMENT_PUBLIC);
ArrayNode lst = (ArrayNode)Json.mapper().readTree(s);
lst.forEach((j)->((ObjectNode)j).remove(TO_REMOVE).remove("@rid"));
return lst;
} catch (SqlInjectionException | IOException e) {
throw new CommandExecutionException(command,"error executing command: "+e.getMessage(),e);
} catch (InvalidCollectionException e) {
throw new CommandExecutionException(command,"invalid collection: "+collection,e);