Cassandra使用PHP SimpleCassie获取所有密钥

时间:2021-03-23 04:49:07

Is it possible to get all keys in a column family using SimpleCassie? I looked at SimpleCassie's google code, but do not figure out.

是否可以使用SimpleCassie获取列族中的所有键?我查看了SimpleCassie的谷歌代码,但不知道。

Another issue is that I used following code to access column value.

另一个问题是我使用以下代码来访问列值。

$price = $cassie->keyspace('ToyStore')->cf('Toys')->key('Transformer')->column('Price')->get();

$ price = $ cassie-> keyspace('ToyStore') - > cf('Toys') - > key('Transformer') - > column('Price') - > get();

echo $price;

It always complains "object of cassandra columnorsupercolumn cannot be converted to string". Is it possible to print out the column value?

它总是抱怨“cassandra columnorsupercolumn的对象不能转换为字符串”。是否可以打印出列值?

1 个解决方案

#1


1  

You should use get_range_slices, start with "", and after each call use the last key as the start key in the next call (disclaimer: haven't tested this with SimpleCassie )

您应该使用get_range_slices,以“”开头,并在每次调用后使用最后一个键作为下一次调用的开始键(免责声明:尚未使用SimpleCassie测试过此)

How do you sort your columns within the column family? LongType for Price?

如何在列族中对列进行排序? LongType的价格?

Valid 'compare_with' values are (from cassandra.yaml) : "AsciiType, UTF8Type, LexicalUUIDType, TimeUUIDType, LongType, and IntegerType (a generic variable-length integer type)

有效的'compare_with'值是(来自cassandra.yaml):“AsciiType,UTF8Type,LexicalUUIDType,TimeUUIDType,LongType和IntegerType(通用可变长度整数类型)

#1


1  

You should use get_range_slices, start with "", and after each call use the last key as the start key in the next call (disclaimer: haven't tested this with SimpleCassie )

您应该使用get_range_slices,以“”开头,并在每次调用后使用最后一个键作为下一次调用的开始键(免责声明:尚未使用SimpleCassie测试过此)

How do you sort your columns within the column family? LongType for Price?

如何在列族中对列进行排序? LongType的价格?

Valid 'compare_with' values are (from cassandra.yaml) : "AsciiType, UTF8Type, LexicalUUIDType, TimeUUIDType, LongType, and IntegerType (a generic variable-length integer type)

有效的'compare_with'值是(来自cassandra.yaml):“AsciiType,UTF8Type,LexicalUUIDType,TimeUUIDType,LongType和IntegerType(通用可变长度整数类型)