cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neha Dave <nehajtriv...@gmail.com>
Subject Nested Collections in Cassandra
Date Tue, 10 Nov 2015 14:14:35 GMT
How can we achieve Nested Collections in cassandra.

My requirement :
metadata map<text,list<text>> ... Is it possible?

Eg. 'mime-type' : 'MIME'
      'Security'  : {'SOX','FOX'}

Query will be Give me all the ID's where 'Security'  : {'SOX'} OR contains
'SOX'

Is it Possible?
Can I use UDT to do it?

Eg CQL :

CREATE TYPE security (
      number text,
      tags set<text>
  );


CREATE TYPE listdata (
      values set<text>
  );

  CREATE TABLE test_path (
      path_id text PRIMARY KEY,
      metadata map<text, frozen<listdata>>
  );

INSERT INTO test_path (path_id, metadata ) VALUES ( '2', { 'mime-type':
{values : {'Mime'}}
{'applicable-security-policy' : {'SOX','FOX'}} });


Query (which does not work) can be :
SELECT * from test_path where metadata CONTAINS {values: {'FOX'}, 'SOX'}} ;
OR
SELECT * from test_path where metadata CONTAINS {values: {'FOX'};


Thanks
Regards
Neha

Mime
View raw message