title: How to call INCRBY and EXPIRE most efficiently in Redis
body: <p>For a collection of aggregate objects that may or may not already exist in Redis, I'd like to call INCRBY and EXPIRE on them. From my reading, it seems using either <a href="https://redis.io/commands/multi" rel="nofollow noreferrer">MULTI</a> or <a href="https://redis.io/commands/eval" rel="nofollow noreferrer">EVAL</a> is the way to go. Following the <a href="https://redis.io/commands/incrby" rel="nofollow noreferrer">INCRBY</a> and <a href="https://redis.io/commands/expire" rel="nofollow noreferrer">EXPIRE</a> operations on the aggregate objects, I need to get back the updated counts of each aggregate that's returned from the INCRBY operation. I'm using the Lettuce client and looking for an example of how best to do this. For simplicity, assume the aggregate object is something like:</p>
  
  <pre><code>public class Aggregate {
    private String id; // key in Redis
    private Long count; // INCRBY operates on
  }
  </code></pre>