0

Is it possible to fetch specific columns from an Azure storage table with the Javascript library.

Right now I can fetch the entire row, but I want just a few of the columns.

Here is what I'm doing to fetch the entire row from the table

var tableUri = "https://mytablerg.table.core.windows.net";
var tableService = AzureStorage.Table.createTableServiceWithSas(tableUri, sasToken);
var tableQuery = new AzureStorage.Table.TableQuery().top(100).where('PartitionKey eq ?', partitionName);

tableService.queryEntities('ChatMessages', tableQuery, null, function(error, result, response) {
   // do some work with a returned data
});

1 Answer 1

4

Appending your original query with method select() should work.

var tableQuery = new AzureStorage.Table.TableQuery().top(100).where('PartitionKey eq ?', partitionName).select('field1','field2');

Have a look at the official doc.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, do you know where I can find documentation for writing these queries in javascript? I can't find much....
@user1186050 Added in my answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.