How to use the express-cassandra.consistencies function in express-cassandra

To help you get started, we’ve selected a few express-cassandra 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 mengwangk / myInvestor / myInvestor-web / server / myinvestor.js View on Github external
function init() {
    // Tell express-cassandra to use the models-directory, and
    // use bind() to load the models using cassandra configurations.
    var host = config.get('cassandra.host');
    var port = config.get('cassandra.port');
    var keyspace = config.get('cassandra.keyspace');
    models.setDirectory(__dirname + '/models').bind({
        clientOptions: {
            contactPoints: [host],
            protocolOptions: { port: port },
            keyspace: keyspace,
            queryOptions: { consistency: models.consistencies.one }
        },
        ormOptions: {
            // If your keyspace doesn't exist it will be created automatically
            // using the default replication strategy provided here.
            defaultReplicationStrategy: {
                class: 'SimpleStrategy',
                replication_factor: 1
            },
            //migration: 'safe',
            migration: 'alter',
            createKeyspace: false
        }
    },
        function (err) {
            if (err)
                console.log(err.message);
github Sunbird-Ed / SunbirdEd-portal / src / app / helpers / eCreds / cassandraUtil.js View on Github external
function getConsistencyLevel(consistency) {
    let consistencyValue = consistency && _.get(models, `consistencies.${consistency}`) ? _.get(models, `consistencies.${consistency}`) : models.consistencies.one
    return consistencyValue;
}
github Sunbird-Ed / SunbirdEd-portal / src / app / helpers / cassandraUtil.js View on Github external
function getConsistencyLevel (consistency) {
  let consistencyValue = consistency && _.get(expressCassandra, `consistencies.${consistency}`) ? _.get(expressCassandra, `consistencies.${consistency}`):  expressCassandra.consistencies.one
  return consistencyValue;
}

express-cassandra

Cassandra Object Models (ORM/ODM/OGM) for NodeJS with support for Apache Cassandra, ScyllaDB, Datastax Enterprise, Elassandra & JanusGraph.

LGPL-3.0
Latest version published 1 year ago

Package Health Score

51 / 100
Full package analysis