1.1.8 • Published 6 years ago

aliyun-tablestore-helper v1.1.8

Weekly downloads
5
License
ISC
Repository
github
Last release
6 years ago

aliyun-tablestore-helper

阿里云 tablestore 辅助方法

const  {TSHelper,TSSet,TSGet,TSRange,TSCreate} = require("aliyun-tablestore-helper");

配置参数

本地创建 ath.yaml ,内容:

accessKeyId: 'xxxxxxxx'
secretAccessKey: 'xxxxxxxxxx'
endpoint: 'https://xxxxxxxx.ots.aliyuncs.com'
instancename: 'xxxxxx'
maxRetries: 20

创建tablestore表

TSCreate.reset("abc",{hash:String},function (err, data) {})

表操作

向tablestore写数据

TSSet.select("abc").put({"a":1},{"b":2})
.attr({"haha":1},{"hehe":2})
.update({"x":9},{"y":8},{"z":7})
.attr({"haha":"1","hehe":"2"});

TSSet.exec(function(err,data){
	callback(null, TSHelper.response(data));
});

向tablestore读数据

TSGet.select("abc")
.get({"a":1},{"b":2})
.get({"x":9},{"y":8},{"z":7})
.attr({"haha":"1"},{"heihei":3})
.select("def")
.get({"hello":1234567});

TSGet.exec(function(err,data){
    data=TSHelper.parse(data);
	callback(null, TSHelper.response(data));
});

从tablestore读取范围数据

TSRange.select("abc")
.range("hash")
.equal({"status":"complete"});

TSRange.exec(function (err, data) {
    data=TSHelper.parse(data);
	TSHelper.parseRange(data);
})
1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago