Class: MaterializedView

Cassandra.Model.MaterializedView

Create a new Cassandra MaterializedView attached to a Cassandra.Schema on the named table and creating the table if it doesn't exist. In general, you should use the instanced method Model.createView() to attach models

Constructor

new MaterializedView(model, name)

Parameters:
Name Type Description
model object the parent model the view will be based off of
name string the materialized view's name, will become the name of the column family
Source:

Extends

Methods

_createPartitionKeyQuery(primaryKeyArray)

Given a primary key array object, this will convert it to a PRIMARY KEY (...) string value to use in table creation
Parameters:
Name Type Description
primaryKeyArray array An array specifying the primary key columns, can be compound and composite as well
Inherited From:
Source:

_qualifyQueryColumns(queryObject) → {array}

Checks the queryObject's properties against the qualified columns
Parameters:
Name Type Description
queryObject object an object representing column:value
Inherited From:
Source:
Throws:
Error - not a valid query column
Returns:
columns - a list of qualified columns
Type
array

find()

Find items in the model's materialized view Similar to Cassandra.AbstractModel#find
Source:
Example
var projection = ['name']; //default "*"
var options = {
  allowFiltering: true,
  limit: 1
};
var query = {
  name: 'foo',
  age: {
    $gt: 30
  }
};
cassandra.find(query, projection, options, (err, result) => console.log(err, result));
// SELECT name FROM <table> WHERE name = 'foo' AND age > 30 LIMIT 1 ALLOW FILTERING

findOne()

Find a single row in the materialized view Similar to Cassandra.AbstractModel#findOne
Source: