title: Why am I getting the following Redis warning and error?
body: <p>When I try to save the following data to Redis:</p>
  
  <pre><code>{ _id: 5c9535a742e1ce2b2ce90be5,
    email: 'admin@admin.com',
    items:
     [ { _id: 5c9535c042e1ce2b2ce90be6, product: [Object], quantity: 1 },
       { _id: 5c9535c642e1ce2b2ce90beb, product: [Object], quantity: 1 } ],
    createdOn: 2019-03-22T19:21:11.349Z,
    __v: 0 }
  </code></pre>
  
  <p>I get the following warning:</p>
  
  <pre><code>node_redis: Deprecated: The SETEX command contains a argument of type model.
  This is converted to "{ _id: 5c9535a742e1ce2b2ce90be5,
    email: 'admin@admin.com',
    items:
     [ { _id: 5c9535c042e1ce2b2ce90be6, product: [Object], quantity: 1 },
       { _id: 5c9535c642e1ce2b2ce90beb, product: [Object], quantity: 1 } ],
    createdOn: 2019-03-22T19:21:11.349Z,
    __v: 0 }" by using .toString() now and will return an error from v.3.0 on.
     Please handle this in your code to make sure everything works as you 
  intended it to.
  </code></pre>
  
  <p>When I try to retrieve the data from Redis, I get the following error:</p>
  
  <pre><code>undefined:1
    { _id: 5c9535a742e1ce2b2ce90be5,
      ^
    SyntaxError: Unexpected token _ in JSON at position 2
     at JSON.parse (&lt;anonymous&gt;)
  </code></pre>
  
  <p>Function used to save to Redis:</p>
  
  <pre><code>exports.setCart = (email, cart) =&gt; {
      cart - JSON.stringify(cart);
      redisClient.setex(email, CACHE_TTL, cart);
  }
  </code></pre>
  
  <p>Function used to retrieve the data from Redis:</p>
  
  <pre><code>exports.getCart = (email, callback) =&gt; {
      redisClient.get(email, (err, cart) =&gt; {
          if(err) {return callback(err, null)}
  
          console.log('CART FROM CACHE ', cart)
      return callback(err, JSON.parse(cart));
      })
  }
  </code></pre>
  
  <p>Function call to save data to redis:</p>
  
  <pre><code>redisClient.setCart(email, cart);
  </code></pre>