How can I query the data in cassandra OR riak if the value of a key in the object is a List
example=>
Genre[Key] : Pop, rock [Values]
I want to list all songs with the genre rock and so on.
Can I do this using Cassandra/Riak’s secondary indexes?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, Riak’s secondary indexes can handle this for you.
You would simply store your objects in Riak and index them with the appropriate genre(s).
Pretend your data looks like this (JSON):
You would store the object and use binary indexes for the genres (example using curl):
To get all songs indexed with “rock” you’d then do: