【问题标题】:Why azure storage table explorer returning wrong result?为什么天蓝色存储表资源管理器返回错误结果?
【发布时间】:2021-04-10 05:38:13
【问题描述】:

正如我们看到的那样,我过滤了结果,所以我得到了 gps_speed > 150 的行, 但我得到的 gps_speed 等于 (25,24,27,...), 我想也许资源管理器有一个错误,所以我输入脚本来做同样的工作仍然得到相同的结果

async function speed1Query(carId,continuationToken){
    speed = "150"
return new Promise((resolve ,reject)=>{
    query = new azure.TableQuery()
    .select(['*'])
    .where('gps_speed gt ?',speed);
    tableSvc.queryEntities('eventsdata', query, continuationToken, (error, results)=> {
        if(!error){
            resolve(results); 
        }else{
            reject(error);
        }
      });
})
}
async function speed1(carId){
    var continuationToken = null;
    do{
        var results =  await speed1Query(carId, continuationToken);
        continuationToken = results.continuationToken;
        
    }
    while(continuationToken!=null);
    return results;
}
async function show(){
      result1 = await speed1("1");
      console.log(result1.entries.length);
      
  }

这是我运行代码时得到的结果

247

与 Azure Explorer 返回的行数相同。

【问题讨论】:

  • “速度”属性的数据类型是什么?

标签: node.js azure azure-table-storage


【解决方案1】:

检查过滤器中列的类型。它进行字母过滤。如果是字符串,“25”>“150”。

【讨论】:

  • 我试过你的解决方案,但不幸的是我仍然得到相同的结果
  • 如果列 gps_speed 的底层数据类型是字符串,那么您也会得到相同的结果。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-02-22
  • 2023-03-12
  • 1970-01-01
  • 1970-01-01
  • 2015-03-07
  • 1970-01-01
相关资源
最近更新 更多