How to use the cassandra-driver.types.Integer function in cassandra-driver

To help you get started, we’ve selected a few cassandra-driver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ahlwong / dakota-cassandra / lib / types.js View on Github external
exports.castValue = function(dakota, value) {
  
  // cassandra tuple
  if (value instanceof nmCassandraTypes.Tuple) {
    value = value.values();
  }
  
  // cassandra types
  if (value instanceof nmCassandraTypes.BigDecimal) {
    return value.toNumber();
  }
  else if (value instanceof nmCassandraTypes.InetAddress) {
    return value.toString();
  }
  else if (value instanceof nmCassandraTypes.Integer) {
    return value.toNumber();
  }
  else if (value instanceof nmCassandraTypes.LocalDate) {
    return value.toString();
  }
  else if (value instanceof nmCassandraTypes.LocalTime) {
    return value.toString();
  }
  else if (value instanceof nmCassandraTypes.TimeUuid) {
    return value.toString();
  }
  else if (value instanceof nmCassandraTypes.Uuid) {
    return value.toString();
  }
  
  // array
github dtoubelis / sails-cassandra / lib / util.js View on Github external
var types = require('cassandra-driver').types,
  Uuid = types.Uuid,
  TimeUuid = types.TimeUuid,
  Integer = types.Integer,
  BigDecimal = types.BigDecimal,
  InetAddress = types.InetAddress,
  LocalDate = types.LocalDate,
  LocalTime = types.LocalTime,
  Long = types.Long;


/**
 * Cast value from Cassandra data type to Waterline type
 *
 * @param value
 * @returns {*}
 */
exports.castFromCassandraToWaterline = function(value) {

  var cast = function(value) {