Classes
AggregateField
An AggregateField is a class that contains data that defines an aggregation.
Datastore
Idiomatic class for interacting with Cloud Datastore. Uses the lower-level class under the hood.
In addition to the constructor options shown here, the Datastore class constructor accepts the same options accepted by .
The Datastore Emulator
Make sure you have the gcloud SDK installed, then run:
$ gcloud beta emulators datastore start --no-legacy
You will see the following printed:
\[datastore\] API endpoint: http://localhost:8005 \[datastore\] If you are using a library that supports the DATASTORE\_EMULATOR\_HOST environment variable, run: \[datastore\] \[datastore\] export DATASTORE\_EMULATOR\_HOST=localhost:8005 \[datastore\] \[datastore\] Dev App Server is now running.
Set that environment variable and your localhost Datastore will automatically be used. You can also pass this address in manually with apiEndpoint.
Additionally, DATASTORE_PROJECT_ID is recognized. If you have this set, you don't need to provide a projectId.
DatastoreRequest
Handles request logic for Datastore API operations.
Creates requests to the Datastore endpoint. Designed to be inherited by the Datastore and Transaction classes.
Index
Key
Build a Datastore Key object.
PropertyFilter
A PropertyFilter is a filter that gets applied to a query directly.
Query
A Query object is used to build and execute queries for entities stored in Datastore.
Create a Query object with or .
Transaction
A transaction is a set of Datastore operations on one or more entities. Each transaction is guaranteed to be atomic, which means that transactions are never partially applied. Either all of the operations in the transaction are applied, or none of them are applied.
Interfaces
BooleanObject
DatastoreOptions
EntityProtoReduceAccumulator
EntityProtoReduceData
ExportEntitiesConfig
ImportEntitiesConfig
KeyToLegacyUrlSafeCallback
LongRunningCallback
TransactionOptions
Functions
and(filters)
export declare function and(filters: EntityFilter[]): 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.
| Parameter | |
|---|---|
| Name | Description |
filters |
EntityFilter[]The list of filters that make up the AND filter. |
| Returns | |
|---|---|
| Type | Description |
CompositeFilter |
{CompositeFilter} A composite AND filter. |
or(filters)
export declare function or(filters: EntityFilter[]): 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.
| Parameter | |
|---|---|
| Name | Description |
filters |
EntityFilter[]The list of filters that make up the OR filter. |
| Returns | |
|---|---|
| Type | Description |
CompositeFilter |
{CompositeFilter} A composite OR filter. |
Type Aliases
Entity
export type Entity = any & EntityWithTransforms;Fallback
export type Fallback = boolean | 'rest' | 'proto';InsertCallback
export type InsertCallback = CommitCallback;InsertResponse
export type InsertResponse = CommitResponse;LongRunningResponse
export type LongRunningResponse = [Operation, google.longrunning.IOperation];PathType
export type PathType = string | number | entity.Int;UpdateCallback
export type UpdateCallback = CommitCallback;UpdateResponse
export type UpdateResponse = CommitResponse;UpsertCallback
export type UpsertCallback = CommitCallback;UpsertResponse
export type UpsertResponse = CommitResponse;