Bifrost
Bifrost

Reputation: 427

is it possible to get row key in cassandra?

I am using astyanax as a client to interact with cassandra. How can i get the row key of a particular row in cassandra?

secondly,can we get the row key of a particular row on the basis of a column ?

e.g;

select row_key from table where age=20;

Upvotes: 0

Views: 553

Answers (1)

Richard
Richard

Reputation: 11110

If you want to find a row by a specific column value then use secondary indexes. If you created an index on the column age it would allow you to do a query like your example.

If you want to find row(s) by paging through all rows, you can use AllRowsReader in Astyanax, details here: https://github.com/Netflix/astyanax/wiki/All-rows-query.

Upvotes: 1

Related Questions