title: Query by map values in Cassandra
body: <p>Lets say that I have column family like this:</p>
  
  <pre><code>CREATE TABLE test(
  id text,
  meta map &lt;text, text&gt;,
  PRIMARY KEY (key)
  );
  </code></pre>
  
  <p>Then I put some data to my <strong>meta</strong> map, for example:  <code>{'username' : 'ivan'}</code></p>
  
  <p>I would like to query my test column family by elements in <strong>meta</strong> map. Something like this:</p>
  
  <p><code>SELECT * FROM test WHERE meta['username'] = 'ivan';</code></p>
  
  <p>According to cassandra <a href="http://www.datastax.com/documentation/cql/3.0/cql/cql_using/use_map_t.html" rel="nofollow">documentation</a> this should be possible: </p>
  
  <blockquote>
    <p>As its name implies, a map maps one thing to another. A map is a name
    and a pair of typed values. Using the map type, you can store
    timestamp-related information in user profiles. <strong>Each element of the
    map is internally stored as one Cassandra column that you can modify,
    replace, delete, and query.</strong></p>
  </blockquote>
  
  <p>But I cannot find any example of this online so is this really possible?</p>
  
  <p>Thanks,
  Ivan</p>