title: Save Array or List of values to Redis cache
body: <p>I'm attemptign to use Redis cloud and push an Array of String values using below code:</p>
  <pre><code>import com.lambdaworks.redis.RedisClient;
  import com.lambdaworks.redis.RedisURI;
  import com.lambdaworks.redis.api.StatefulRedisConnection;
  import com.lambdaworks.redis.api.sync.RedisCommands;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  public class WriteToRedis {
  
      private static final Logger logger = LoggerFactory.getLogger(ExchangeCurrencyPairScenario.class);
  
      public static void main(String[] args) throws JsonProcessingException {
  
          RedisClient redisClient = new RedisClient(
                  RedisURI.create(&quot;redis://****@cloud.redislabs.com:15162&quot;));
          StatefulRedisConnection&lt;String, String&gt; connection = redisClient.connect();
          System.out.println(&quot;Connected to Redis&quot;);
          RedisCommands&lt;String, String&gt; syncCommands = connection.sync();
          syncCommands.rpush(&quot;key&quot; , new String[]{&quot;Volvo&quot;, &quot;BMW&quot;, &quot;Ford&quot;, &quot;Mazda&quot;});
          connection.close();
          redisClient.shutdown();
  }
  </code></pre>
  <p>But receive exception:</p>
  <pre><code>Exception in thread &quot;main&quot; com.lambdaworks.redis.RedisCommandExecutionException: WRONGTYPE Operation against a key holding the wrong kind of value
      at com.lambdaworks.redis.LettuceFutures.await(LettuceFutures.java:127)
      at com.lambdaworks.redis.LettuceFutures.awaitOrCancel(LettuceFutures.java:96)
      at com.lambdaworks.redis.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:61)
      at com.lambdaworks.redis.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
      at com.sun.proxy.$Proxy0.rpush(Unknown Source)
      at com.reactive.api.redis.WriteToRedis.main(WriteToRedis.java:39)
  </code></pre>
  <p>I can save String values and connect to the Redis cloud cache with no issue. But it seems I have not configured the format of the value associated with the &quot;key&quot; correctly? How to correctly persist and Array (or List) of values to a Redis cache using Java?</p>