I want to use the following code to update a field ...
@@db.execute("UPDATE user_count SET counters = counters + #{val} WHERE cid = 1 ")
The first time I tried, I got the following:
CassandraCQL :: Error :: InvalidRequestException: invalid operation for non-commutation columnfamily user_count
I found out that I need to use a comparator counter, but I can’t find how I can configure this using cassandra -cql gem ... does anyone know how I can make this work? below is my code that doesn't work ...
@@db.execute("CREATE COLUMNFAMILY user_count(cid varchar PRIMARY KEY, counters counter) with comparator = counter " )
@@db.execute("INSERT INTO user_count (cid, counters) VALUES (?,?)", 1, 0)
source
share