ResultRow object

This object is part of a ResultRows packet, and contains one row. This is the object that is passed as the context.row variable to result set filters.

Properties

The values in the row can be accessed by name, keeping in mind that the column names will typically be in lowercase, unless they were specifically defined in the schema using quotes.

For instance, if you have a table in Cassandra like:

CREATE TABLE gallium_demo.customers (

    id            INT PRIMARY KEY,

    firstName    TEXT,

    lastName     TEXT,

    country       TEXT,

    phones        MAP<TEXT, FROZEN<TypePhone>>

);

then, in a result set filter, you can access and modify the values of the columns for the current row with:

let fName = context.row.firstname;

if (context.row.country === 'DE') {

    context.row.firstname = context.row.firstname.substring(0, 1) + "XXX";

}

let homeNum = context.row.phones.home;

See Cassandra data types for information on how the Cassandra data types are mapped to JavaScript and back.


Methods