google app engine - How to delete an entity by property in gae datastore -
key newwordkey = keyfactory.createkey(newword_key_kind, newword_key); entity newword = new entity(newword_entity_kind, newwordkey); newword.setproperty(user_col_username, username); newword.setproperty(newword_col, word); datastore.put(newword);
i mean want delete "newword" entity property "username" ex, delete words upload user "alexis" idea ? thx
use delete entities query function:
query q = pm.newquery(newword_kind.class); q.setfilter("user_col_username == usr"); q.declareparameters("string usr"); q.deletepersistentall("alexis");
hope helps.
Comments
Post a Comment