Global

Members

TransactionState

By default a DatastoreRequest is in the NOT_TRANSACTION state. If the DatastoreRequest is a Transaction object, then initially it will be in the NOT_STARTED state, but then the state will become IN_PROGRESS after the transaction has started.

Methods

and(filters) → {CompositeFilter}

And filters are composed of many other filters and when they are applied then query results are only returned when they pass through all these other filters.

Parameters:
Name Type Description
filters Array.<EntityFilter>

The list of filters that make up the AND filter.

Returns:
Type Description
CompositeFilter

A composite AND filter.

buildEntityProto()

This function builds the entity proto from the entity object. We cannot rely on entity.entityToEntityProto for this because this function is only designed to be used for non-array entities.

buildPropertyTransforms(transforms)

This method takes the user supplied transforms object and returns a list of corresponding transforms that are instead in the shape of the protos so that they can be included in the grpc request to the service directly.

Parameters:
Name Type Description
transforms

The transforms supplied by the user that the user intends to apply.

extendExcludeFromIndexes(entityObject)

This function extends the excludeFromIndexes list when it finds large properties in the entity object. The extended excludeFromIndexes list is then used when building the entity proto.

Parameters:
Name Type Description
entityObject Entity

The entity object to parse for properties to add to the excludeFromIndexes list.

getTransactionRequest(transaction, options)

This function gets transaction request options used for defining a request to create a new transaction on the server.

Parameters:
Name Type Description
transaction Transaction

The transaction for which the request will be made.

options RunOptions

Custom options that will be used to create the request.

isTransaction(request)

Check to see if a request is a Transaction

Parameters:
Name Type Description
request DatastoreRequest

The Datastore request object

or(filters) → {CompositeFilter}

Or filters are composed of many other filters and when they are applied then query results are returned when they pass through any of these other filters.

Parameters:
Name Type Description
filters Array.<EntityFilter>

The list of filters that make up the OR filter.

Returns:
Type Description
CompositeFilter

A composite OR filter.

throwOnTransactionErrors(request, options)

Throw an error if read options are not properly specified.

Parameters:
Name Type Description
request DatastoreRequest

The Datastore request object

options SharedQueryOptions

The Query options

Type Definitions

IntegerTypeCastOptions

Configuration to convert values of integerValue type to a custom value. Must provide an integerTypeCastFunction to handle integerValue conversion.

Properties:
Name Type Attributes Description
integerTypeCastFunction function

A custom user provided function to convert integerValue.

properties string | Array.<string> <optional>

Entity property names to be converted using integerTypeCastFunction.