Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Datastore

import { Datastore } from "https://googleapis.deno.dev/v1/datastore:v1.ts";

Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.

class Datastore {
constructor(client?: CredentialsClient, baseUrl?: string);
async projectsAllocateIds(projectId: string, req: AllocateIdsRequest): Promise<AllocateIdsResponse>;
async projectsBeginTransaction(projectId: string, req: BeginTransactionRequest): Promise<BeginTransactionResponse>;
async projectsCommit(projectId: string, req: CommitRequest): Promise<CommitResponse>;
async projectsExport(projectId: string, req: GoogleDatastoreAdminV1ExportEntitiesRequest): Promise<GoogleLongrunningOperation>;
async projectsImport(projectId: string, req: GoogleDatastoreAdminV1ImportEntitiesRequest): Promise<GoogleLongrunningOperation>;
async projectsIndexesCreate(projectId: string, req: GoogleDatastoreAdminV1Index): Promise<GoogleLongrunningOperation>;
async projectsIndexesDelete(indexId: string, projectId: string): Promise<GoogleLongrunningOperation>;
async projectsIndexesGet(indexId: string, projectId: string): Promise<GoogleDatastoreAdminV1Index>;
async projectsIndexesList(projectId: string, opts?: ProjectsIndexesListOptions): Promise<GoogleDatastoreAdminV1ListIndexesResponse>;
async projectsLookup(projectId: string, req: LookupRequest): Promise<LookupResponse>;
async projectsOperationsCancel(name: string): Promise<Empty>;
async projectsOperationsDelete(name: string): Promise<Empty>;
async projectsOperationsGet(name: string): Promise<GoogleLongrunningOperation>;
async projectsOperationsList(name: string, opts?: ProjectsOperationsListOptions): Promise<GoogleLongrunningListOperationsResponse>;
async projectsReserveIds(projectId: string, req: ReserveIdsRequest): Promise<ReserveIdsResponse>;
async projectsRollback(projectId: string, req: RollbackRequest): Promise<RollbackResponse>;
async projectsRunAggregationQuery(projectId: string, req: RunAggregationQueryRequest): Promise<RunAggregationQueryResponse>;
async projectsRunQuery(projectId: string, req: RunQueryRequest): Promise<RunQueryResponse>;
}

§Constructors

§
new Datastore(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§
projectsAllocateIds(projectId: string, req: AllocateIdsRequest): Promise<AllocateIdsResponse>
[src]

Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted.

@param projectId

Required. The ID of the project against which to make the request.

§
projectsBeginTransaction(projectId: string, req: BeginTransactionRequest): Promise<BeginTransactionResponse>
[src]

Begins a new transaction.

@param projectId

Required. The ID of the project against which to make the request.

§
projectsCommit(projectId: string, req: CommitRequest): Promise<CommitResponse>
[src]

Commits a transaction, optionally creating, deleting or modifying some entities.

@param projectId

Required. The ID of the project against which to make the request.

§
projectsExport(projectId: string, req: GoogleDatastoreAdminV1ExportEntitiesRequest): Promise<GoogleLongrunningOperation>
[src]

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

@param projectId

Required. Project ID against which to make the request.

§
projectsImport(projectId: string, req: GoogleDatastoreAdminV1ImportEntitiesRequest): Promise<GoogleLongrunningOperation>
[src]

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

@param projectId

Required. Project ID against which to make the request.

§
projectsIndexesCreate(projectId: string, req: GoogleDatastoreAdminV1Index): Promise<GoogleLongrunningOperation>
[src]

Creates the specified index. A newly created index's initial state is CREATING. On completion of the returned google.longrunning.Operation, the state will be READY. If the index already exists, the call will return an ALREADY_EXISTS status. During index creation, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, removing the index with delete, then re-creating the index with create. Indexes with a single property cannot be created.

@param projectId

Project ID against which to make the request.

§
projectsIndexesDelete(indexId: string, projectId: string): Promise<GoogleLongrunningOperation>
[src]

Deletes an existing index. An index can only be deleted if it is in a READY or ERROR state. On successful execution of the request, the index will be in a DELETING state. And on completion of the returned google.longrunning.Operation, the index will be removed. During index deletion, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, followed by calling delete again.

@param indexId

The resource ID of the index to delete.

@param projectId

Project ID against which to make the request.

§
projectsIndexesGet(indexId: string, projectId: string): Promise<GoogleDatastoreAdminV1Index>
[src]

Gets an index.

@param indexId

The resource ID of the index to get.

@param projectId

Project ID against which to make the request.

§
projectsIndexesList(projectId: string, opts?: ProjectsIndexesListOptions): Promise<GoogleDatastoreAdminV1ListIndexesResponse>
[src]

Lists the indexes that match the specified filters. Datastore uses an eventually consistent query to fetch the list of indexes and may occasionally return stale results.

@param projectId

Project ID against which to make the request.

§
projectsLookup(projectId: string, req: LookupRequest): Promise<LookupResponse>
[src]

Looks up entities by key.

@param projectId

Required. The ID of the project against which to make the request.

§
projectsOperationsCancel(name: string): Promise<Empty>
[src]

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.

@param name

The name of the operation resource to be cancelled.

§
projectsOperationsDelete(name: string): Promise<Empty>
[src]

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

@param name

The name of the operation resource to be deleted.

§
projectsOperationsGet(name: string): Promise<GoogleLongrunningOperation>
[src]

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

@param name

The name of the operation resource.

§
projectsOperationsList(name: string, opts?: ProjectsOperationsListOptions): Promise<GoogleLongrunningListOperationsResponse>
[src]

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.

@param name

The name of the operation's parent resource.

§
projectsReserveIds(projectId: string, req: ReserveIdsRequest): Promise<ReserveIdsResponse>
[src]

Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.

@param projectId

Required. The ID of the project against which to make the request.

§
projectsRollback(projectId: string, req: RollbackRequest): Promise<RollbackResponse>
[src]

Rolls back a transaction.

@param projectId

Required. The ID of the project against which to make the request.

§
projectsRunAggregationQuery(projectId: string, req: RunAggregationQueryRequest): Promise<RunAggregationQueryResponse>
[src]

Runs an aggregation query.

@param projectId

Required. The ID of the project against which to make the request.

§
projectsRunQuery(projectId: string, req: RunQueryRequest): Promise<RunQueryResponse>
[src]

Queries for entities.

@param projectId

Required. The ID of the project against which to make the request.