@Override public Output update(String id, Map<String, Object> deltas) { DBUpdate.Builder update = new DBUpdate.Builder(); for (Map.Entry<String, Object> fields : deltas.entrySet()) update = update.set(fields.getKey(), fields.getValue()); return coll.findAndModify(DBQuery.is(OutputImpl.FIELD_ID, id), null, null, false, update, true, false); }
@Override public Output update(String id, Map<String, Object> deltas) { DBUpdate.Builder update = new DBUpdate.Builder(); for (Map.Entry<String, Object> fields : deltas.entrySet()) update = update.set(fields.getKey(), fields.getValue()); return coll.findAndModify(DBQuery.is("_id", id), update); }
/** * Set the given field (can be multiple levels deep) to the given value * atomically * * @param field * The field to set * @param value * The value to set it to * @return this object */ public static Builder set(String field, Object value) { return new Builder().set(field, value); }