Guest User

Untitled

a guest
May 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Map<String, Object> updateInfo; // Key is db column name, value is updatedValue
  2.  
  3. Then create update operations:
  4.  
  5. Query<Entity> filter = datastore.createQuery(Entity.class)
  6. .field("_id", id);
  7.  
  8. UpdateOperations<Entity> updateOps = datastore.createUpdateOperations(Entity.class);
  9.  
  10. updateInfo.entrySet().forEach(e -> updateOps.set(e.getKey(), e.getValue());
  11.  
  12. datastore.update(filter, updateOps);
Add Comment
Please, Sign In to add comment