Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想删除所有实体。我发现如果我想删除一个实体,
// Key employeeKey = ...; datastore.delete(employeeKey);
上面的代码可以删除一个实体。但我想删除所有实体。有什么好的方法可以一次性删除吗?只能删除每个实体吗?
delete 方法可以接受一个参数Iterable<Key>,所以做类似的事情
Iterable<Key>
List<Key> keys = Arrays.asList(key1, key2, key3); datastore.delete(keys);
https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreService#delete%28java.lang.Iterable%29