Openscihub Cassandra
This package is basically a wrapper around the Node.JS cassandra-driver, which does the heavy lifting with the CQL protocol. Its purpose is to help build CQL query strings based on config objects.
Usage
var merge = ;var CassandraTable = Table;var CassandraClient = Client; // First define your POJO model using the POD scheme. Add a// "storage" attribute to each POD to tell the CassandraTable// mixin how and if it should store the thing. var UserModel = attrs: username: { if !/^[a-z]+$/ return 'Must be a-z'; } storage: cassandra: 'ascii' pg: 'varchar(32)' key: 'username'; // Now imbue it with Cassandra creation, storage, and retrieval.var UserTable = ; UserTableclient = /* driver options */ ;UserTable;UserTable;UserTable;UserTable;
Documentation
Table
create(callback)
drop(callback)
select(opts, callback)
opts
Object, requiredopts.where
String, requiredopts.consistency
callback
Function(err, results), required
Testing
First, follow the instructions here to start a Cassandra instance in VirtualBox: