new ColumnFamily
Representation of a Column Family
Parameters:
Name | Type | Description |
---|---|---|
definition |
Object | The Column Family definition |
- Source:
- column_family.js, line 168
Members
-
<private, static, constant> DEFAULT_READ_CONSISTENCY
-
Default read consistency level
- Source:
- column_family.js, line 20
-
<private, static, constant> DEFAULT_WRITE_CONSISTENCY
-
Default write consistency level
- Source:
- column_family.js, line 28
Methods
-
get
-
Get a row by its key
Parameters:
Name Type Description key
String The key to get options
Object Options for the get, can have start, end, max, consistencyLevel - start: the from part of the column name
- end: the to part of the column name
- max: the max amount of columns to return
- columns: an {Array} of column names to get
- consistencyLevel: the read consistency level
callback
Function The callback to invoke once the response has been received - Source:
- column_family.js, line 271
-
getIndexed
-
Gets rows by their indexed fields
Parameters:
Name Type Description query
Object Options for the rows part of the get - fields: an array of objects thjat contain { column:column_name, operator: 'EQ', value:value }
- column: {String} The name of the column with the index
- operator: {String} The operator to use, can be EQ, GTE, GT, LTE, ot LT
- value: {String} The value to query by
- start: the start key to get
- max: the total amount of rows to return
options
Object Options for the get, can have start, end, max, consistencyLevel - start: the from part of the column name
- end: the to part of the column name
- max: the max amount of columns to return
- columns: an {Array} of column names to get
- consistencyLevel: the read consistency level
callback
Function The callback to invoke once the response has been received - Source:
- column_family.js, line 332
- fields: an array of objects thjat contain { column:column_name, operator: 'EQ', value:value }
-
insert
-
Performs a set command to the cluster
Parameters:
Name Type Description key
String The key for the row columns
Object The value for the columns as represented by JSON or an array of Column objects options
Object The options for the insert callback
Function The callback to call once complete - Source:
- column_family.js, line 200
-
remove
-
Remove a single row or column This function uses a variable-length paramter list. Which parameters are passed depends on which column path should be used for the removal and whether this column family is a super column or not.
Parameters:
Name Type Description key
String The key for this row (required) column
Object The column name (optional) subcolumn
Object The subcolumn name (optional) options
Object The thrift options for this operation (optional) callback
Function The callback to call once complete (optional) - Source:
- column_family.js, line 244
-
truncate
-
Truncates a ColumnFamily
Parameters:
Name Type Description callback
Function The callback to invoke once the ColumnFamily has been truncated - Source:
- column_family.js, line 304
-
<private, static> columnParent
-
Returns a column parent When calculating the column parent of a standard column family, the parent is simply the column family name. When dealing with super columns on the other hand, an optional name parameter may be provided.
Parameters:
Name Type Description cf
Object A reference to the ColumnFamily name
Object The name of the column (optional) - Source:
- column_family.js, line 43
Returns:
a Thrift ColumnParent object- Type
- Object
-
<private, static> getColumns
-
Gets an array of columns from an object
Parameters:
Name Type Description columns
Object - Source:
- column_family.js, line 119
Returns:
and array of columns- Type
- Array
-
<private, static> getSlicePredicate
-
Gets a slcie predicate based on some options
- Source:
- column_family.js, line 141
Returns:
- Type
- SlicePredicate
-
<private, static> NOOP
-
NO-Operation for deault callbacks
- Source:
- column_family.js, line 12
-
<private, static> normalizeParameters
-
A convenience method to normalize the standard parameters used by a thrift operation. The parameter list must contain a `key` parameter as it's first item. The `column`, `subcolumn`, `options`, and `callback` parameters are optional.
Parameters:
Name Type Description list
Array The list of parameters - Source:
- column_family.js, line 92
Returns:
a normalized version of the provided parameter values- Type
- Object