开发者

How can I get the key of a colum in cassandra using php?

开发者 https://www.devze.com 2022-12-18 17:55 出处:网络
How can i get the keys of the column having sex = male. Using the php library from http://wiki.apache.org/cassandra/ClientExamples

How can i get the keys of the column having sex = male. Using the php library from http://wiki.apache.org/cassandra/ClientExamples

For example my keys are

0,1,2

key: 0 { column( name:age, value:24), column( name:sex, value:female) }

key: 1 { column( name:age, value:24), column( name:sex, value:female) }

key: 2 { column( name:age,开发者_运维知识库 value:26), column( name:sex, value:male) }


Currently you need to create another ColumnFamily, e.g. UserSex, and make each indexed value in the original CF a key in the new one. So you would have 'male' and 'female' be keys, with either columns of the user id, or (denormalizing) supercolumns containing the entire user record, so you don't have to do a multiget after the index get.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号