The wiki mentions using the following syntax for deleting (using findAndDelete):
Datastore ds = ...
Hotel grandSierra = ds.findAndDelete(ds.get(Hotel.class, "Grand Sierra
Resort"));
However, the findAndDelete method expects a Query object as parameter, and
ds.get(Hotel.class, "Gran Sierra Resort") returns a Hotel object (only if I
pass in an iterable as second argument a Query object is returned). What I
really want to accomplish is a atomic findanddelete operation given that I know
the object id, but it is unclear to me how this is supposed to be done.
Morphia 1.00-20110403/MongoLab
Original issue reported on code.google.com by slindhom on 25 Oct 2012 at 7:25
Original issue reported on code.google.com by
slindhom
on 25 Oct 2012 at 7:25