Class: TableBatch

TableBatch

new TableBatch()

Creates a new TableBatch.

Source:

Methods

addOperation(operationType, entity, options) → {undefined}

Adds an operation to the batch after performing checks.

Parameters:
Name Type Argument Description
operationType string

The type of operation to perform. See Constants.TableConstants.Operations

entity object

The entity.

options object <optional>

The request options.

Source:
Returns:
Type
undefined

clear() → {undefined}

Removes all of the operations from the batch.

Source:
Returns:
Type
undefined

deleteEntity(entity) → {undefined}

Adds a delete operation to the batch.

Parameters:
Name Type Description
entity object

The entity.

Source:
Returns:
Type
undefined

getOperation(index) → {object}

Gets an operation from the batch. Returns null if the index does not exist.

Parameters:
Name Type Description
index number

The index in the operations array at which to remove an element.

Source:
Returns:

The removed operation.

Type
object

hasOperations() → {Boolean}

Returns a boolean value indicating weather there are operations in the batch.

Source:
Returns:

True if there are operations queued up; false otherwise.

Type
Boolean

insertEntity(entity, options) → {undefined}

Adds an insert operation to the batch.

Parameters:
Name Type Argument Description
entity object

The entity.

options object <optional>

The request options.

Properties
Name Type Argument Description
echoContent string <optional>

Whether or not to return the entity upon a successful insert. Inserts only, default to false.

payloadFormat string <optional>

The payload format to use for the request.

propertyResolver TableService~propertyResolver <optional>

The property resolver. Only applied if echoContent is true. Given the partition key, row key, property name, property value, and the property Edm type if given by the service, returns the Edm type of the property.

entityResolver function <optional>

The entity resolver. Only applied if echoContent is true. Given the single entity returned by the insert, returns a modified object.

Source:
Returns:
Type
undefined

insertOrMergeEntity(entity) → {undefined}

Adds an insert or merge operation to the batch.

Parameters:
Name Type Description
entity object

The entity.

Source:
Returns:
Type
undefined

insertOrReplaceEntity(entity) → {undefined}

Adds an insert or replace operation to the batch.

Parameters:
Name Type Description
entity object

The entity.

Source:
Returns:
Type
undefined

mergeEntity(entity) → {undefined}

Adds a merge operation to the batch.

Parameters:
Name Type Description
entity object

The entity.

Source:
Returns:
Type
undefined

removeOperation(index) → {object}

Removes an operation from the batch. Returns null if the index does not exist.

Parameters:
Name Type Description
index number

The index in the operations array at which to remove an element.

Source:
Returns:

The removed operation.

Type
object

retrieveEntity(partitionKey, rowKey, options) → {undefined}

Adds a retrieve operation to the batch. Note that this must be the only operation in the batch.

Parameters:
Name Type Argument Description
partitionKey string

The partition key.

rowKey string

The row key.

options object <optional>

The request options.

Properties
Name Type Argument Description
payloadFormat string <optional>

The payload format to use for the request.

propertyResolver TableService~propertyResolver <optional>

The property resolver. Given the partition key, row key, property name, property value, and the property Edm type if given by the service, returns the Edm type of the property.

entityResolver function <optional>

The entity resolver. Given the single entity returned by the query, returns a modified object.

Source:
Returns:
Type
undefined

size() → {number}

Returns the number of operations in the batch.

Source:
Returns:

The number of operations in the batch.

Type
number

updateEntity(entity) → {undefined}

Adds an update operation to the batch.

Parameters:
Name Type Description
entity object

The entity.

Source:
Returns:
Type
undefined