MongoScriptRunner runner = new MongoScriptRunner();
DB db = mongoDB.getDB(getDatabase(), getUsername(), getPassword());
res.latencyEnd();
Object result = runner.evaluate(db, data);
EvalResultHandler handler = new EvalResultHandler();
String resultAsString = handler.handle(result);
res.setResponseData(resultAsString.getBytes());
} catch (Exception ex) {
res.setResponseCode("500"); // $NON-NLS-1$
res.setSuccessful(false);
res.setResponseMessage(ex.toString());