Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
node.js addon for cassandra
JavaScript
branch: master

This branch is 3 commits ahead, 1 commit behind yukim:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
gen-nodejs
lib
test
README.rst
package.json

README.rst

About

node_cassandra is node.js addon for Apache Cassandra(http://cassandra.apache.org). node_cassandra originally used C++ thrift client, but thanks to node.js support in Thrift ver 0.6, current version uses only javascript. Currently, only cassandra 0.7.x is supported.

Requirement

node-thrift, but if you install node_cassandra with npm, it should be installed as well.

Installation

$ npm install cassandra

of

$ git clone https://github.com/yukim/node_cassandra.git

$ npm install .

Usage

Example usage:

var cassandra = require("cassandra");
var client = new cassandra.Client("host:port");
var CL = cassandra.ConsistencyLevel;

client.consistencyLevel({
  write: CL.ONE,
  read: CL.ONE
});

client.connect("SomeKeySpace");
var cf = client.getColumnFamily("SomeColumnFamily");

var data = cf.get("key", function(err, data) {
  // play with data
  console.log(data.columnName);
});

For more detailed example, see test/test.js.

Test

If you have expresso installed, you can run test with:

$ expresso -I lib

Limitation

Following APIs are not yet supported.

  • get_range_slice
  • get_index_slice
  • system_* (schema modification APIs)

License

Apache 2.0 License

Something went wrong with that request. Please try again.