PHP Azure 表存储筛选分区键以外的列进行筛选


PHP Azure table storage filter on column other than partition key to filter

我正在使用 PHP Azure 表存储 REST API,当我使用分区键以外的任何其他列来过滤数据集时,它给了我独特的错误

如果我使用以下过滤条件,它可以正常工作。

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223'))

如果我添加除Parition键以外的任何其他列,则会出现错误。 例如,当我在下面使用过滤器时,它会生成错误

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223') and (cid <> '11081'))

它说在非对象上调用成员函数getEntities()。

try {
        $result = $tableRestProxy->queryEntities("mytable", $filter);
    }
    catch(ServiceException $e){
        // Handle exception based on error codes and messages.
        // Error codes and messages are here: 
        // http://msdn.microsoft.com/en-us/library/windowsazure/dd179438.aspx
        $code = $e->getCode();
        $error_message = $e->getMessage();
        echo $code.": ".$error_message."<br />";
    }
    $entities = $result->getEntities();

我正在使用教程 http://www.windowsazure.com/en-us/develop/php/how-to-guides/table-service/中提供的逻辑

我认为您的查询语法本身存在错误。尝试将查询从以下位置更改为:

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223') and (cid <> '11081'))

((PartitionKey ge '2013110100') and (PartitionKey le '2013110223') and (cid ne '11081'))

请在此处查看支持的比较运算符:http://msdn.microsoft.com/en-us/library/windowsazure/dd894031.aspx。