Skip to content

Instantly share code, notes, and snippets.

@johnlpage
Created March 28, 2023 07:51
Show Gist options
  • Save johnlpage/b0ec2861859fdb0adbfc23661527e912 to your computer and use it in GitHub Desktop.
Save johnlpage/b0ec2861859fdb0adbfc23661527e912 to your computer and use it in GitHub Desktop.
public String getMOTResultInJSON(String identifier) {
long identifierLong;
try {
identifierLong = Long.valueOf(identifier);
Bson byIdQuery = Filters.eq("vehicleid", identifierLong);
testObj = testresults.find(byIdQuery).limit(1).first();
if (testObj != null) {
return testObj.toJson();
}
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
}
return "{ }"; // Not found
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment