-
Notifications
You must be signed in to change notification settings - Fork 4
Table Storage
The table storage API functionality can be put into two groups: (1) methods provided with 'storage' that allow manipulation of the tables themselves and (2) methods on the 'table' object used to manipulate table attributes and data.
These methods are accessible via the storage
object. In reality, the functionality is found in static methods of the Table
object -- these proxy methods are provided for convenience.
Creates a new table with the supplied tableName
on this storage account. callback
is passed a reference to the newly created table.
Lists all tables in this storage account. Invokes callback
with an array of table names.
Removes the table specified by tableName
.
Returns a reference to a table (the same as returned by storage.createTable
).
The createTable
and table
methods above return an instance of the Table
object. This object provides the following methods:
Inserts the key/value pairs specified in data
into the table using the supplied partition
and row
keys. Boolean, Number, String and DateTime datatypes supported -- Number currently defaults to Edm.Double
.
Replaces any existing data at the supplied partition
and row
keys with the values provided in data
. Available options include:
- upsert - When
true
, and no row currently exists atpartition
androw
, the data will be inserted. Defaults tofalse
.
Removes the table data at the supplied partition
and row
keys.
Defines a subset of fields to be returned from a query, specified in fieldArray. Can be useful for performance and bandwidth optimization.
Applies a filter to the rows that will be returned from a query.
Applies any fields
or filters
and invokes callback
with an array of the results.
Applies any fields
or filters
and invokes callback
for each row in the results and (optionally) doneCallback
with the count of rows when done. (Errors are sent to callback
, or doneCallback
if provided. Both callback and doneCallback expect 'err' as their first parameter.)
filter
and field
are meant to be chained with all
or forEach
in a fluent API style, for example:
table.fields(['firstName','lastName']).filter({'state':'CA'}).forEach(callback, doneCallback);