How to use the cassandra-driver.types.Long 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 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) {

    var ret = value;

    if (value instanceof Uuid) {
      ret = value.toString();