i would like to know how to use CQL to insert a new column to a row...
Is it possible? If not, how can i do that easily by using Fluent Cassandra?
Thanks.
i would like to know how to use CQL to insert a new column to a row...
Is it possible? If not, how can i do that easily by using Fluent Cassandra?
Thanks.
Using FluentCassandra, you can add a new column to an existing row quite easily:
var cFamily = db.GetColumnFamily("TestCF");
cFamily.InsertColumn(rowKey, columnName, columnValue);
Alternatively, you can do it like this:
var cFamily = db.GetColumnFamily("TestCF");
var record = cFamily.CreateRecord(existingRowKey) //record already exists
record[newColumnName] = newColumnValue;
CQL expects you to define your schema up front. If you want dynamic schema, you must use one of the Thrift-based clients. Fluent Cassandra supports this; check here.