title: How to define TYPES with Cassandra Consistencies?
body: <p>I have the following:</p>
  
  <pre><code>var cassandra = require('cassandra-driver');
  var clientCass = new cassandra.Client({
      contactPoints: ['localhost'],
      keyspace: 'localhost'
  });
  </code></pre>
  
  <p>Towards the bottom of the code, I'm doing this:</p>
  
  <pre><code>//Now add a row or Check to see if the session already exists
          var query = "INSERT INTO localhost.shirosessions     (id,expired,last_access_ts,start_ts) \n\
                  VALUES ('" + theSession.sessionid + "',false,'" 
                  + component.getTimeStampA() + "','" + component.getTimeStampA() + "') IF NOT EXISTS";
  
  
          //var params = [];
          var consistency = client.cql.types.consistencies.quorum;
          //client.executeAsPrepared(query, params, consistency, function (err) {
          clientCass.execute(query, consistency, function (err) {
              if (err)
                  console.log('Something when wrong and the row was not Inserted', err);
              else {
                  console.log('Inserted on the cluster! Yay!');
              }
          });
  </code></pre>
  
  <p>BUT, the error I'm getting is this:</p>
  
  <pre><code>TypeError: Cannot read property 'types' of undefined
  </code></pre>
  
  <p>I don't understand? Where is TYPES defined? How?</p>
  
  <p>I'm new to Cassandra and yet I've been using MSSQL Server since the late 90s and have a clear understanding of SQL.</p>
  
  <p>Thanks if you can help.</p>
  
  <p>Also, is putting "IF EXISTS" the only way to ensure a UNIQUE record?</p>