Reputation: 7077
Utilizing the manual editor in Azure Storage Explorer I can create the following query that returns the results I want from the Azure Table Storage:
TYPE eq 'MYTYPE' and (PartitionKey eq '1' or PartitionKey eq '2')
However, I'm not sure how to do this with the NodeJS library.
The following code:
const azure = require('azure-storage');
const svc = new azure.TableService();
var azureQuery = new azure.TableQuery().where("TYPE eq 'MYTYPE'").or("PartitionKey eq '1'").or("PartitionKey eq '2'")
Is equivalent to the query:
TYPE eq 'MYTYPE' or PartitionKey eq '1' or PartitionKey eq '2'
Likewise I can do the following:
const azure = require('azure-storage');
const svc = new azure.TableService();
var azureQuery = new azure.TableQuery().where("TYPE eq 'MYTYPE'").and("PartitionKey eq '1'").or("PartitionKey eq '2'")
But that results in the query:
TYPE eq 'MYTYPE' and PartitionKey eq '1' or PartitionKey eq '2'
How do I do the equivalent of parenthesis from the NodeJS library?
Upvotes: 0
Views: 841
Reputation: 24138
As I known, the simple way is like the code below based on my understanding for the TableQuery
object.
var filter = "TYPE eq 'MYTYPE' and ( PartitionKey eq '1' or PartitionKey eq '2' )"
var azureQuery = new azure.TableQuery().where(filter)
It works fine.
Upvotes: 2