This repository was archived by the owner on May 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 563
Table Storage
Tuskan360 edited this page Apr 8, 2012
·
8 revisions
To ensure a table exists, call createTableIfNotExists:
var tableService = azure.createTableService();
tableService.createTableIfNotExists('tasktable', function(error){
if(!error){
// Table exists
}
});
A new entity can be added by calling insertEntity:
var tableService = azure.createTableService(),
task1 = {
PartitionKey : 'tasksSeattle',
RowKey: '1',
Description: 'Take out the trash',
DueDate: new Date(2011, 12, 14, 12)
};
tableService.insertEntity('tasktable', task1, function(error){
if(!error){
// Entity inserted
}
});
The method queryEntity can then be used to fetch the entity that was just inserted:
var tableService = azure.createTableService();
tableService.queryEntity('tasktable', 'tasksSeattle', '1', function(error, serverEntity){
if(!error){
// Entity available in serverEntity variable
}
});
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, servicePropertiesResult, response)) The callback function
- serviceProperties
- (object) The service properties
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, response)) The callback function