Search code examples
cassandraapigee

Apigee Cassandra, how to query property with array of objects?


Suppose this is my data:

{
    "info": [
       {
            "name": "Dr. DRE"
       }
    ]
}

How do I query in Cassandra all rows that have "Dr. DRE" as name?

select * where ..?

I have no idea, and didn't find anything useful on google...


Solution

  • Since we clarified that you're using and not a native Cassandra instance, this should work for you:

    where info.name='Dr. DRE'
    

    (Note that in Usergrid 1.0, select * is implied, but you can include it if you like)

    While the use of the = in this case may seem a little strange, you can use that to look for values in an array.