未验证 提交 d2e4a365 编写于 作者: 葛亚芳 提交者: Gitee

update en/application-dev/reference/apis/js-apis-distributed-data.md.

Signed-off-by: Nge-yafang <geyafang@huawei.com>
上级 25786530
......@@ -2453,10 +2453,10 @@ try {
console.log('entries: ' + JSON.stringify(entries));
kvStore.putBatch(entries, async function (err,data) {
console.log('putBatch success');
kvStore.getEntries('batch_test_string_key', function (err,entrys) {
kvStore.getEntries('batch_test_string_key', function (err,entries) {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
});
});
}catch(e) {
......@@ -2505,7 +2505,7 @@ try {
console.log('entries: ' + JSON.stringify(entries));
kvStore.putBatch(entries).then(async (err) => {
console.log('putBatch success');
kvStore.getEntries('batch_test_string_key').then((entrys) => {
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.log('getEntries success');
console.log('PutBatch ' + JSON.stringify(entries));
}).catch((err) => {
......@@ -3245,10 +3245,10 @@ try {
}
kvStore.putBatch(entries, async function (err,data) {
console.log('putBatch success');
kvStore.getEntries('batch_test_number_key', function (err,entrys) {
kvStore.getEntries('batch_test_number_key', function (err,entries) {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
});
});
}catch(e) {
......@@ -3297,12 +3297,12 @@ try {
console.log('entries: ' + entries);
kvStore.putBatch(entries).then(async (err) => {
console.log('putBatch success');
kvStore.getEntries('batch_test_string_key').then((entrys) => {
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entrys[0].value: ' + JSON.stringify(entrys[0].value));
console.log('entrys[0].value.value: ' + entrys[0].value.value);
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
console.log('entries[0].value: ' + JSON.stringify(entries[0].value));
console.log('entries[0].value.value: ' + entries[0].value.value);
}).catch((err) => {
console.log('getEntries fail ' + JSON.stringify(err));
});
......@@ -3353,10 +3353,10 @@ try {
console.log('putBatch success');
const query = new distributedData.Query();
query.prefixKey("batch_test");
kvStore.getEntries(query, function (err,entrys) {
kvStore.getEntries(query, function (err,entries) {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
});
});
console.log('GetEntries success');
......@@ -3409,7 +3409,7 @@ try {
console.log('putBatch success');
const query = new distributedData.Query();
query.prefixKey("batch_test");
kvStore.getEntries(query).then((entrys) => {
kvStore.getEntries(query).then((entries) => {
console.log('getEntries success');
}).catch((err) => {
console.log('getEntries fail ' + JSON.stringify(err));
......@@ -4412,10 +4412,10 @@ try {
console.log('entries: ' + entries);
kvStore.putBatch(entries, async function (err,data) {
console.log('putBatch success');
kvStore.getEntries('localDeviceId', 'batch_test_string_key', function (err,entrys) {
kvStore.getEntries('localDeviceId', 'batch_test_string_key', function (err,entries) {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
});
});
}catch(e) {
......@@ -4465,12 +4465,12 @@ try {
console.log('entries: ' + entries);
kvStore.putBatch(entries).then(async (err) => {
console.log('putBatch success');
kvStore.getEntries('localDeviceId', 'batch_test_string_key').then((entrys) => {
kvStore.getEntries('localDeviceId', 'batch_test_string_key').then((entries) => {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entrys[0].value: ' + JSON.stringify(entrys[0].value));
console.log('entrys[0].value.value: ' + entrys[0].value.value);
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
console.log('entries[0].value: ' + JSON.stringify(entries[0].value));
console.log('entries[0].value.value: ' + entries[0].value.value);
}).catch((err) => {
console.log('getEntries fail ' + JSON.stringify(err));
});
......@@ -4522,10 +4522,10 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
query.deviceId('localDeviceId');
kvStore.getEntries(query, function (err,entrys) {
kvStore.getEntries(query, function (err,entries) {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
});
});
console.log('GetEntries success');
......@@ -4578,7 +4578,7 @@ try {
console.log('putBatch success');
const query = new distributedData.Query();
query.prefixKey("batch_test");
kvStore.getEntries(query).then((entrys) => {
kvStore.getEntries(query).then((entries) => {
console.log('getEntries success');
}).catch((err) => {
console.log('getEntries fail ' + JSON.stringify(err));
......@@ -4633,10 +4633,10 @@ try {
var query = new distributedData.Query();
query.deviceId('localDeviceId');
query.prefixKey("batch_test");
kvStore.getEntries('localDeviceId', query, function (err,entrys) {
kvStore.getEntries('localDeviceId', query, function (err,entries) {
console.log('getEntries success');
console.log('entrys.length: ' + entrys.length);
console.log('entrys[0]: ' + JSON.stringify(entrys[0]));
console.log('entries.length: ' + entries.length);
console.log('entries[0]: ' + JSON.stringify(entries[0]));
})
});
console.log('GetEntries success');
......@@ -4691,7 +4691,7 @@ try {
var query = new distributedData.Query();
query.deviceId('localDeviceId');
query.prefixKey("batch_test");
kvStore.getEntries('localDeviceId', query).then((entrys) => {
kvStore.getEntries('localDeviceId', query).then((entries) => {
console.log('getEntries success');
}).catch((err) => {
console.log('getEntries fail ' + JSON.stringify(err));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册