aliyun / aliyun-tablestore-nodejs-sdk

Aliyun TableStore(原OTS) SDK for Node.js
Apache License 2.0
88 stars 33 forks source link

在进行全匹配查询时 报错 TypeError: name.endsWith is not a function #46

Closed qgc007 closed 1 year ago

qgc007 commented 3 years ago

我在仿照 https://help.aliyun.com/document_detail/100613.html?spm=a2c4g.11186623.6.1015.74103645q4lQ7l 写代码时,报出错误,但是我的代码应该没有问题,请问这个是bug吗? 以下是错误信息

我的代码:

var client = require('./client');
var TableStore = require('tablestore');

client.search({
    tableName: "JeolShareSendFailDataTable",
    indexName: "idx_file_nm",
    searchQuery: {
        offset: 0,
        limit: 10, //如果只为了获取行数,无需获取具体数据,可以设置limit=0,即不返回任意一行数据。
        query: {
            queryType: TableStore.QueryType.MATCH_ALL_QUERY
        },
        getTotalCount: true //结果中的TotalCount可以表示表中数据的总行数,默认为false,表示不返回。
    },
    columnToGet: { //返回列设置RETURN_SPECIFIED(自定义)、RETURN_ALL(所有列)和RETURN_NONE(不返回)。
        returnType: TableStore.ColumnReturnType.RETURN_SPECIFIED,
        returnNames: ["file_name"]
    }
}, function (err, data) {
    if (err) {
        console.log('error:', err);
    }else{
        console.log('success:', JSON.stringify(data, null, 2));
}

});

错误信息: H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:66 throw err; ^

TypeError: name.endsWith is not a function at formatError (internal/util/inspect.js:914:13) at formatRaw (internal/util/inspect.js:703:14) at formatValue (internal/util/inspect.js:591:10) at inspect (internal/util/inspect.js:221:10) at formatWithOptions (internal/util/inspect.js:1693:40) at Object.Console. (internal/console/constructor.js:272:10) at Object.log (internal/console/constructor.js:282:61) at Response. (H:\work_file\nodejs-pj\search.js:22:17) at Request. (H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:162:18) at Request.callListeners (H:\work_file\nodejs-pj\node_modules\tablestore\lib\sequential_executor.js:113:20)

qgc007 commented 3 years ago

nodejs更新成最新版本后的报错,上面的版本是12 error: 400: OTSUnsupportOperation(Unsupported operation: 'Empty endpoint'. at Request.extractError (H:\work_file\nodejs-pj\node_modules\tablestore\lib\client.js:92:44) at Request.callListeners (H:\work_file\nodejs-pj\node_modules\tablestore\lib\sequential_executor.js:113:20) at Request.emit (H:\work_file\nodejs-pj\node_modules\tablestore\lib\sequential_executor.js:81:10) at Request.emit (H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:189:14) at Request.transition (H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:57:10) at AcceptorStateMachine.runTo (H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:24:12) at H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:36:10 at Request. (H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:73:9) at Request. (H:\work_file\nodejs-pj\node_modules\tablestore\lib\request.js:191:12) at Request.callListeners (H:\work_file\nodejs-pj\node_modules\tablestore\lib\sequential_executor.js:90:20) { code: 400, headers: { date: 'Wed, 14 Apr 2021 13:34:32 GMT', 'transfer-encoding': 'chunked', connection: 'keep-alive', authorization: 'OTS LTAI5tR2n6fLdRm7axqy3w6G:kIv79PZBnTAoHw81k0p5fWPkP9o=', 'x-ots-contentmd5': 'omCQ6u5oxD8DR6byfuIcwQ==', 'x-ots-contenttype': 'protocol buffer', 'x-ots-date': '2021-04-14T13:34:32.427008Z', 'x-ots-requestid': '0005bfee-ce93-2ced-5e6b-ca0b0298f962' }, time: 2021-04-14T13:34:31.637Z, retryable: false }

qgc007 commented 3 years ago

已解决,原因是多元索引的使用 不支持日本东京