如何用PHPCassa以相反顺序获取单列中的列?如何用PHPCassa以相反顺序获取列
2
A
回答
2
技巧是用空列切片对象完成的。
...
$cf = new ColumnFamily($pool, 'mycolumnfamily');
// normal order
$rows = $cf->get('mykey');
print_r($rows);
// reverse order, 5 is column count, true is reverse order
$rows = $cf->get('mykey', new ColumnSlice(null, null, 5, true));
print_r($rows);
3
从phpcassa文档
public function get($key,
$columns=null,
$column_start="",
$column_finish="",
$column_reversed=False,
$column_count=self::DEFAULT_COLUMN_COUNT,
$super_column=null,
$read_consistency_level=null)
见“@param bool $column_reversed
取列以相反的顺序”
将此参数设置为 “true” 会以相反的顺序读取列。
您甚至可以为multiget,get_range和get_indexed_slices查询设置此参数。
有关详细信息请参考:phpcassa columnfamily documentation
相关问题
- 1. 以相反顺序获取xml值
- 2. 如何以相反的顺序
- 3. 如何以相反顺序登录?
- 4. 如何以相反顺序循环?
- 5. 在highchart如何以相反的顺序
- 6. 与JSON相比,以相反的顺序获取数据
- 7. 如何使用pycassa get_range以反向排序顺序获取行?
- 8. Bot以相反顺序排列网格
- 9. 以相反顺序打印阵列
- 10. php数组以相反顺序排列
- 11. 以相反的顺序
- 12. 以相反的顺序
- 13. unpickle以相反的顺序
- 14. 以相反的顺序
- 15. TemplateBeginRepeat以相反的顺序
- 16. Plist以相反的顺序
- 17. 如何获取相反顺序的计数?
- 18. 如何在python中以相反顺序读取csv文件
- 19. 如何以相反的顺序读取PS文件?
- 20. 以相反顺序从字符串中获取值
- 21. Thymeleaf:如何以相反顺序遍历列表?
- 22. 如何在Grails中以相反顺序迭代对象列表?
- 23. 如何在Android中以相反顺序显示阵列
- 24. 获取给定系列的相反顺序的编号
- 25. 以相反的顺序填充列的引用另一列
- 26. Accidentialy以相反的顺序获取可观察列表的项目
- 27. 如何在android中以相反顺序反转youTube feed Json?
- 28. 按相反顺序排序列表
- 29. 如何使用phpcassa获取cassandra中所有行的列名?
- 30. 如何使用嵌套循环以相反顺序打印
你链接到似乎是一个旧版本(基本上0.8.a.2)的文档。最新版本可以在这里找到:http://thobbs.github.com/phpcassa/api/class-phpcassa.ColumnFamily.html#_get –
是的,这是旧的。 – Nick
好吧我没有想到它....需要看看新的API,谢谢泰勒和尼克 – samarth