1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| 添加记录 put 'users','Zeeny','info:age','30'; put 'users','Zeeny','info:birthday','1984-06-03'; put 'users','Zeeny','info:company','cnzxsoft'; put 'users','Zeeny','address:contry','china'; put 'users','Zeeny','address:province','anhui'; put 'users','Zeeny','address:city','heifei'; put 'users','Xhuoban','info:birthday','1987-4-17'; put 'users','Xhuoban','info:favorite','movie'; put 'users','Xhuoban','info:company','cnzxsoft'; put 'users','Xhuoban','address:contry','china'; put 'users','Xhuoban','address:province','anhui'; put 'users','Xhuoban','address:city','fuyang'; put 'users','Xhuoban','address:town','zhangji' 获取一条记录 1.取得一个id的所有数据 get 'users','Zeeny' 2.获取一个id,一个列族的所有数据 get 'users','Zeeny','info' 3.获取一个id,一个列族中一个列的所有数据 get 'users','Zeeny','info:age' 更新记录 put 'users','Zeeny','info:age','29' get 'users','Zeeny','info:age' put 'users','Zeeny','info:age','30' 获取单元格数据的版本数据 get 'users', 'Zeeny',{COLUMN=>'info:age',VERSIONS=>1} get 'users', 'Zeeny',{COLUMN=>'info:age',VERSIONS=>2} get 'users', 'Zeeny',{COLUMN=>'info:age',VERSIONS=>3} 获取单元格数据的某个版本数据 get 'users','Zeeny',{COLUMN=>'info:age',TIMESTAMP=>1418615226809} 全表扫描 scan 'users' 删除Zeeny值的'info:age'字段 delete 'users', 'Zeeny', 'info:age' get 'users', 'Zeeny' 删除整行 deleteall 'users','Zeeny' 统计表的行数 count 'users' 清空表 truncate 'users'
|