I'm trying to find out if an Object (document) exists in a collection.
Here's what I've tried but I'm stuck.
@DbTable(name = "websites")
private MongoCollection websitesTable;
private boolean isInTable(String url) {
FindOne p = websitesTable.findOne("{url: #}", url);
return false;
}
How do I check, if given url
is already in the collection? Any help appreciated.