Constructor
new ColumnFamily(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:
Methods
_createTable(callback)
Parameters:
Name |
Type |
Description |
callback |
function
|
receives err, result |
- Source:
_createViews(callback)
Parameters:
Name |
Type |
Description |
callback |
function
|
receives err, result |
- Source:
createIndex(index, done)
Create an Index on the current table
Parameters:
Name |
Type |
Description |
index |
string
|
object
|
a string of the index name that will be automatically mapped, or an object with a single key as the index who's value is the custom index name to be stored in the database. |
done |
function
|
receives err, result |
- Source:
Example
createIndex('myIndex', ...); // translates to <table>_myindex_idx
createIndex({myIndex: 'custom_index_mapping'}, ...); // does not get translated
createView(viewName, config, callback|querystring, noQualify)
Creates a new materialized view and attachs it to the model Cassandra.Model#views
The create query that is generated will mixin any missing primary keys from the model,
this means if your model has a composite key [a,b] and your view sets a composite key of
[[c,d],e
Parameters:
Name |
Type |
Description |
viewName |
string
|
the name of the current view |
config |
object
|
the views configuration object |
callback|querystring |
function
|
boolean
|
if callback, receieves err, result. Else if "false" will return querystring, this is strict |
noQualify |
boolean
|
do not attempt to qualify the configuration |
- Source: