Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Map<String, Object> updateInfo; // Key is db column name, value is updatedValue
- Then create update operations:
- Query<Entity> filter = datastore.createQuery(Entity.class)
- .field("_id", id);
- UpdateOperations<Entity> updateOps = datastore.createUpdateOperations(Entity.class);
- updateInfo.entrySet().forEach(e -> updateOps.set(e.getKey(), e.getValue());
- datastore.update(filter, updateOps);
Add Comment
Please, Sign In to add comment