\[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.
The Datastore Admin API provides several admin services for Cloud Datastore.
Concepts: Project, namespace, kind, and entity as defined in the Google Cloud Datastore API.
Operation: An Operation represents work being performed in the background.
EntityFilter: Allows specifying a subset of entities in a project. This is specified as a combination of kinds and namespaces (either or both of which may be all).
Export/Import Service:
The Export/Import service provides the ability to copy all or a subset of entities to/from Google Cloud Storage. - Exported data may be imported into Cloud Datastore for any Google Cloud Platform project. It is not restricted to the export source project. It is possible to export from one project and then import into another. - Exported data can also be loaded into Google BigQuery for analysis. - Exports and imports are performed asynchronously. An Operation resource is created for each export/import. The state (including any errors encountered) of the export/import may be queried via the Operation resource.
Index Service:
The index service manages Cloud Datastore composite indexes. - Index creation and deletion are performed asynchronously. An Operation resource is created for each such asynchronous operation. The state of the operation (including any errors encountered) may be queried via the Operation resource.
Operation Service:
The Operations collection provides a record of actions performed for the specified project (including any operations in progress). Operations are not created directly but through calls on other collections or resources. - An operation that is not yet done may be cancelled. The request to cancel is asynchronous and the operation may continue to run for some time after the request to cancel is made. - An operation that is done may be deleted so that it is no longer listed as part of the Operation collection. - ListOperations returns all pending operations, but not completed operations. - Operations are created by service DatastoreAdmin, but are accessed via service google.longrunning.Operations. v1
Each RPC normalizes the partition IDs of the keys in its input entities, and always returns entities with keys with normalized partition IDs. This applies to all keys and entities, including those in values, except keys with both an empty path and an empty or unset partition ID. Normalization of input keys sets the project ID (if not already set) to the project ID from the request.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Package @google-cloud/datastore (9.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [9.1.0 (latest)](/nodejs/docs/reference/datastore/latest/overview)\n- [8.7.0](/nodejs/docs/reference/datastore/8.7.0/overview)\n- [8.6.0](/nodejs/docs/reference/datastore/8.6.0/overview)\n- [8.5.0](/nodejs/docs/reference/datastore/8.5.0/overview)\n- [8.4.0](/nodejs/docs/reference/datastore/8.4.0/overview)\n- [8.3.0](/nodejs/docs/reference/datastore/8.3.0/overview)\n- [8.2.2](/nodejs/docs/reference/datastore/8.2.2/overview)\n- [8.1.0](/nodejs/docs/reference/datastore/8.1.0/overview)\n- [8.0.0](/nodejs/docs/reference/datastore/8.0.0/overview)\n- [6.6.2](/nodejs/docs/reference/datastore/6.6.2/overview)\n- [6.5.0](/nodejs/docs/reference/datastore/6.5.0/overview)\n- [6.4.8](/nodejs/docs/reference/datastore/6.4.8/overview)\n- [6.3.1](/nodejs/docs/reference/datastore/6.3.1/overview) \n\nClasses\n-------\n\n### [AggregateField](/nodejs/docs/reference/datastore/latest/datastore/aggregatefield)\n\nAn AggregateField is a class that contains data that defines an aggregation.\n\n### [Datastore](/nodejs/docs/reference/datastore/latest/datastore/datastore)\n\nIdiomatic class for interacting with Cloud Datastore. Uses the lower-level [DatastoreClient](/nodejs/docs/reference/datastore/latest/datastore/datastoreclient) class under the hood.\n\nIn addition to the constructor options shown here, the [Datastore](/nodejs/docs/reference/datastore/latest/datastore/datastore) class constructor accepts the same options accepted by [DatastoreClient](/nodejs/docs/reference/datastore/latest/datastore/datastoreclient).\n\n#### The Datastore Emulator\n\nMake sure you have the [gcloud SDK installed](https://cloud.google.com/sdk/downloads), then run: \n\n```\n $ gcloud beta emulators datastore start --no-legacy \n```\n\nYou will see the following printed: \n\n```\n \\[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. \n```\n\nSet that environment variable and your localhost Datastore will automatically be used. You can also pass this address in manually with `apiEndpoint`.\n\nAdditionally, `DATASTORE_PROJECT_ID` is recognized. If you have this set, you don't need to provide a `projectId`.\n\nSee [Cloud Datastore Concepts Overview](https://cloud.google.com/datastore/docs/concepts/overview)\n\n### [DatastoreAdminClient](/nodejs/docs/reference/datastore/latest/datastore/datastoreadminclient)\n\nGoogle Cloud Datastore Admin API\n\nThe Datastore Admin API provides several admin services for Cloud Datastore.\n\nConcepts: Project, namespace, kind, and entity as defined in the Google Cloud Datastore API.\n\nOperation: An Operation represents work being performed in the background.\n\nEntityFilter: Allows specifying a subset of entities in a project. This is specified as a combination of kinds and namespaces (either or both of which may be all).\n\nExport/Import Service:\n\n- The Export/Import service provides the ability to copy all or a subset of entities to/from Google Cloud Storage. - Exported data may be imported into Cloud Datastore for any Google Cloud Platform project. It is not restricted to the export source project. It is possible to export from one project and then import into another. - Exported data can also be loaded into Google BigQuery for analysis. - Exports and imports are performed asynchronously. An Operation resource is created for each export/import. The state (including any errors encountered) of the export/import may be queried via the Operation resource.\n\nIndex Service:\n\n- The index service manages Cloud Datastore composite indexes. - Index creation and deletion are performed asynchronously. An Operation resource is created for each such asynchronous operation. The state of the operation (including any errors encountered) may be queried via the Operation resource.\n\nOperation Service:\n\n- The Operations collection provides a record of actions performed for the specified project (including any operations in progress). Operations are not created directly but through calls on other collections or resources. - An operation that is not yet done may be cancelled. The request to cancel is asynchronous and the operation may continue to run for some time after the request to cancel is made. - An operation that is done may be deleted so that it is no longer listed as part of the Operation collection. - ListOperations returns all pending operations, but not completed operations. - Operations are created by service DatastoreAdmin, but are accessed via service google.longrunning.Operations. v1\n\n### [DatastoreClient](/nodejs/docs/reference/datastore/latest/datastore/datastoreclient)\n\nEach RPC normalizes the partition IDs of the keys in its input entities, and always returns entities with keys with normalized partition IDs. This applies to all keys and entities, including those in values, except keys with both an empty path and an empty or unset partition ID. Normalization of input keys sets the project ID (if not already set) to the project ID from the request.\n\nv1\n\n### [DatastoreRequest](/nodejs/docs/reference/datastore/latest/datastore/datastorerequest)\n\nHandle logic for Datastore API operations. Handles request logic for Datastore.\n\nCreates requests to the Datastore endpoint. Designed to be inherited by the [Datastore](/nodejs/docs/reference/datastore/latest/datastore/datastore) and [Transaction](/nodejs/docs/reference/datastore/latest/datastore/transaction) classes.\n\n### [Index](/nodejs/docs/reference/datastore/latest/datastore)\n\n### [Key](/nodejs/docs/reference/datastore/latest/datastore/key)\n\nBuild a Datastore Key object.\n\n### [PropertyFilter](/nodejs/docs/reference/datastore/latest/datastore/propertyfilter)\n\nA PropertyFilter is a filter that gets applied to a query directly.\n\n### [Query](/nodejs/docs/reference/datastore/latest/datastore/query)\n\nBuild a Query object.\n\n\\*\\*Queries are built with {module:datastore#createQuery} and .\\*\\*\n\n### [Transaction](/nodejs/docs/reference/datastore/latest/datastore/transaction)\n\nA 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.\n\nInterfaces\n----------\n\n### [BooleanObject](/nodejs/docs/reference/datastore/latest/datastore/booleanobject)\n\n### [DatastoreOptions](/nodejs/docs/reference/datastore/latest/datastore/datastoreoptions)\n\n### [EntityProtoReduceAccumulator](/nodejs/docs/reference/datastore/latest/datastore/entityprotoreduceaccumulator)\n\n### [EntityProtoReduceData](/nodejs/docs/reference/datastore/latest/datastore/entityprotoreducedata)\n\n### [ExportEntitiesConfig](/nodejs/docs/reference/datastore/latest/datastore/exportentitiesconfig)\n\n### [ImportEntitiesConfig](/nodejs/docs/reference/datastore/latest/datastore/importentitiesconfig)\n\n### [KeyToLegacyUrlSafeCallback](/nodejs/docs/reference/datastore/latest/datastore/keytolegacyurlsafecallback)\n\n### [LongRunningCallback](/nodejs/docs/reference/datastore/latest/datastore/longrunningcallback)\n\n### [TransactionOptions](/nodejs/docs/reference/datastore/latest/datastore/transactionoptions)\n\nVariables\n---------\n\n### v1\n\n v1: any\n\nFunctions\n---------\n\n### and(filters)\n\n export declare function and(filters: EntityFilter[]): CompositeFilter;\n\n### or(filters)\n\n export declare function or(filters: EntityFilter[]): CompositeFilter;\n\nType Aliases\n------------\n\n### Entity\n\n export type Entity = any;\n\n### Fallback\n\n export type Fallback = boolean | 'rest' | 'proto';\n\n### InsertCallback\n\n export type InsertCallback = CommitCallback;\n\n### InsertResponse\n\n export type InsertResponse = CommitResponse;\n\n### LongRunningResponse\n\n export type LongRunningResponse = [Operation, google.longrunning.IOperation];\n\n### PathType\n\n export type PathType = string | number | entity.Int;\n\n### UpdateCallback\n\n export type UpdateCallback = CommitCallback;\n\n### UpdateResponse\n\n export type UpdateResponse = CommitResponse;\n\n### UpsertCallback\n\n export type UpsertCallback = CommitCallback;\n\n### UpsertResponse\n\n export type UpsertResponse = CommitResponse;"]]