google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

FindAndDelete from wiki example not working? #438

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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