Cassandra frugality: add data

If I need to add data (not insert) to a custom column, what should I do?

For example: Consider an existing entry described below.

Kespace : test
columFamily: testColum
SuperColumn : testSuper
column_name : email
value : urssujith@gmail.com

      

Here if I want to add my phone number to the "testSuper" super column. What should I do?

+2


a source to share


1 answer


Make a simple insert (with the same key) where your ColumnParent denotes the correct SCF and SC

(Java example)



client.insert(
    keyspace, 
    key, 
    parent, 
    new Column("phoneNumber".getBytes("UTF-8"), "555-14921911".getBytes("UTF-8"), timestamp), 
    ConsistencyLevel.ONE
);

      

+3


a source







All Articles