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.
v1
Package
@google-cloud/datastoreConstructors
(constructor)(opts)
constructor
(
opts
?:
ClientOptions
);
Construct an instance of DatastoreClient.
opts
ClientOptions
Properties
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
string
auth
auth
:
gax
.
GoogleAuth
;
gax. GoogleAuth
datastoreStub
datastoreStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
Promise
<{
[name: string]: Function
;
}>
descriptors
descriptors
:
Descriptors
;
Descriptors
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
{
[name: string]: Function
;
}
port
static
get
port
()
:
number
;
The port for this API service.
number
scopes
static
get
scopes
()
:
string
[];
The scopes needed to make gRPC calls for every method defined in this service.
string[]
servicePath
static
get
servicePath
()
:
string
;
The DNS address for this API service.
string
warn
warn
:
(
code
:
string
,
message
:
string
,
warnType
?:
string
)
=
>
void
;
(code: string, message: string, warnType?: string) => void
Methods
allocateIds(request, options)
allocateIds
(
request
?:
protos
.
google
.
datastore
.
v1
.
IAllocateIdsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
datastore
.
v1
.
IAllocateIdsResponse
,
protos
.
google
.
datastore
.
v1
.
IAllocateIdsRequest
|
undefined
,
{}
|
undefined
]>;
request
protos. google.datastore.v1.IAllocateIdsRequest
options
CallOptions
Promise
<[protos. google.datastore.v1.IAllocateIdsResponse
, protos. google.datastore.v1.IAllocateIdsRequest
| undefined, {} | undefined]>
allocateIds(request, options, callback)
allocateIds
(
request
:
protos
.
google
.
datastore
.
v1
.
IAllocateIdsRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IAllocateIdsResponse
,
protos
.
google
.
datastore
.
v1
.
IAllocateIdsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IAllocateIdsRequest
options
CallOptions
callback
Callback
<protos. google.datastore.v1.IAllocateIdsResponse
, protos. google.datastore.v1.IAllocateIdsRequest
| null | undefined, {} | null | undefined>
void
allocateIds(request, callback)
allocateIds
(
request
:
protos
.
google
.
datastore
.
v1
.
IAllocateIdsRequest
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IAllocateIdsResponse
,
protos
.
google
.
datastore
.
v1
.
IAllocateIdsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IAllocateIdsRequest
callback
Callback
<protos. google.datastore.v1.IAllocateIdsResponse
, protos. google.datastore.v1.IAllocateIdsRequest
| null | undefined, {} | null | undefined>
void
beginTransaction(request, options)
beginTransaction
(
request
?:
protos
.
google
.
datastore
.
v1
.
IBeginTransactionRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
datastore
.
v1
.
IBeginTransactionResponse
,
protos
.
google
.
datastore
.
v1
.
IBeginTransactionRequest
|
undefined
,
{}
|
undefined
]>;
request
protos. google.datastore.v1.IBeginTransactionRequest
options
CallOptions
Promise
<[protos. google.datastore.v1.IBeginTransactionResponse
, protos. google.datastore.v1.IBeginTransactionRequest
| undefined, {} | undefined]>
beginTransaction(request, options, callback)
beginTransaction
(
request
:
protos
.
google
.
datastore
.
v1
.
IBeginTransactionRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IBeginTransactionResponse
,
protos
.
google
.
datastore
.
v1
.
IBeginTransactionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IBeginTransactionRequest
options
CallOptions
callback
Callback
<protos. google.datastore.v1.IBeginTransactionResponse
, protos. google.datastore.v1.IBeginTransactionRequest
| null | undefined, {} | null | undefined>
void
beginTransaction(request, callback)
beginTransaction
(
request
:
protos
.
google
.
datastore
.
v1
.
IBeginTransactionRequest
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IBeginTransactionResponse
,
protos
.
google
.
datastore
.
v1
.
IBeginTransactionRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IBeginTransactionRequest
callback
Callback
<protos. google.datastore.v1.IBeginTransactionResponse
, protos. google.datastore.v1.IBeginTransactionRequest
| null | undefined, {} | null | undefined>
void
close()
close
()
:
Promise<void>
;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Promise
<void>
{Promise} A promise that resolves when the client is closed.
commit(request, options)
commit
(
request
?:
protos
.
google
.
datastore
.
v1
.
ICommitRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
datastore
.
v1
.
ICommitResponse
,
protos
.
google
.
datastore
.
v1
.
ICommitRequest
|
undefined
,
{}
|
undefined
]>;
request
protos. google.datastore.v1.ICommitRequest
options
CallOptions
Promise
<[protos. google.datastore.v1.ICommitResponse
, protos. google.datastore.v1.ICommitRequest
| undefined, {} | undefined]>
commit(request, options, callback)
commit
(
request
:
protos
.
google
.
datastore
.
v1
.
ICommitRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
ICommitResponse
,
protos
.
google
.
datastore
.
v1
.
ICommitRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.ICommitRequest
options
CallOptions
callback
Callback
<protos. google.datastore.v1.ICommitResponse
, protos. google.datastore.v1.ICommitRequest
| null | undefined, {} | null | undefined>
void
commit(request, callback)
commit
(
request
:
protos
.
google
.
datastore
.
v1
.
ICommitRequest
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
ICommitResponse
,
protos
.
google
.
datastore
.
v1
.
ICommitRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.ICommitRequest
callback
Callback
<protos. google.datastore.v1.ICommitResponse
, protos. google.datastore.v1.ICommitRequest
| null | undefined, {} | null | undefined>
void
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
void
initialize()
initialize
()
:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Promise
<{
[name: string]: Function
;
}>
{Promise} A promise that resolves to an authenticated service stub.
lookup(request, options)
lookup
(
request
?:
protos
.
google
.
datastore
.
v1
.
ILookupRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
datastore
.
v1
.
ILookupResponse
,
protos
.
google
.
datastore
.
v1
.
ILookupRequest
|
undefined
,
{}
|
undefined
]>;
request
protos. google.datastore.v1.ILookupRequest
options
CallOptions
Promise
<[protos. google.datastore.v1.ILookupResponse
, protos. google.datastore.v1.ILookupRequest
| undefined, {} | undefined]>
lookup(request, options, callback)
lookup
(
request
:
protos
.
google
.
datastore
.
v1
.
ILookupRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
ILookupResponse
,
protos
.
google
.
datastore
.
v1
.
ILookupRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.ILookupRequest
options
CallOptions
callback
Callback
<protos. google.datastore.v1.ILookupResponse
, protos. google.datastore.v1.ILookupRequest
| null | undefined, {} | null | undefined>
void
lookup(request, callback)
lookup
(
request
:
protos
.
google
.
datastore
.
v1
.
ILookupRequest
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
ILookupResponse
,
protos
.
google
.
datastore
.
v1
.
ILookupRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.ILookupRequest
callback
Callback
<protos. google.datastore.v1.ILookupResponse
, protos. google.datastore.v1.ILookupRequest
| null | undefined, {} | null | undefined>
void
reserveIds(request, options)
reserveIds
(
request
?:
protos
.
google
.
datastore
.
v1
.
IReserveIdsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
datastore
.
v1
.
IReserveIdsResponse
,
protos
.
google
.
datastore
.
v1
.
IReserveIdsRequest
|
undefined
,
{}
|
undefined
]>;
request
protos. google.datastore.v1.IReserveIdsRequest
options
CallOptions
Promise
<[protos. google.datastore.v1.IReserveIdsResponse
, protos. google.datastore.v1.IReserveIdsRequest
| undefined, {} | undefined]>
reserveIds(request, options, callback)
reserveIds
(
request
:
protos
.
google
.
datastore
.
v1
.
IReserveIdsRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IReserveIdsResponse
,
protos
.
google
.
datastore
.
v1
.
IReserveIdsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IReserveIdsRequest
options
CallOptions
callback
Callback
<protos. google.datastore.v1.IReserveIdsResponse
, protos. google.datastore.v1.IReserveIdsRequest
| null | undefined, {} | null | undefined>
void
reserveIds(request, callback)
reserveIds
(
request
:
protos
.
google
.
datastore
.
v1
.
IReserveIdsRequest
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IReserveIdsResponse
,
protos
.
google
.
datastore
.
v1
.
IReserveIdsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IReserveIdsRequest
callback
Callback
<protos. google.datastore.v1.IReserveIdsResponse
, protos. google.datastore.v1.IReserveIdsRequest
| null | undefined, {} | null | undefined>
void
rollback(request, options)
rollback
(
request
?:
protos
.
google
.
datastore
.
v1
.
IRollbackRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
datastore
.
v1
.
IRollbackResponse
,
protos
.
google
.
datastore
.
v1
.
IRollbackRequest
|
undefined
,
{}
|
undefined
]>;
request
protos. google.datastore.v1.IRollbackRequest
options
CallOptions
Promise
<[protos. google.datastore.v1.IRollbackResponse
, protos. google.datastore.v1.IRollbackRequest
| undefined, {} | undefined]>
rollback(request, options, callback)
rollback
(
request
:
protos
.
google
.
datastore
.
v1
.
IRollbackRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IRollbackResponse
,
protos
.
google
.
datastore
.
v1
.
IRollbackRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IRollbackRequest
options
CallOptions
callback
Callback
<protos. google.datastore.v1.IRollbackResponse
, protos. google.datastore.v1.IRollbackRequest
| null | undefined, {} | null | undefined>
void
rollback(request, callback)
rollback
(
request
:
protos
.
google
.
datastore
.
v1
.
IRollbackRequest
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IRollbackResponse
,
protos
.
google
.
datastore
.
v1
.
IRollbackRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IRollbackRequest
callback
Callback
<protos. google.datastore.v1.IRollbackResponse
, protos. google.datastore.v1.IRollbackRequest
| null | undefined, {} | null | undefined>
void
runQuery(request, options)
runQuery
(
request
?:
protos
.
google
.
datastore
.
v1
.
IRunQueryRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
datastore
.
v1
.
IRunQueryResponse
,
protos
.
google
.
datastore
.
v1
.
IRunQueryRequest
|
undefined
,
{}
|
undefined
]>;
request
protos. google.datastore.v1.IRunQueryRequest
options
CallOptions
Promise
<[protos. google.datastore.v1.IRunQueryResponse
, protos. google.datastore.v1.IRunQueryRequest
| undefined, {} | undefined]>
runQuery(request, options, callback)
runQuery
(
request
:
protos
.
google
.
datastore
.
v1
.
IRunQueryRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IRunQueryResponse
,
protos
.
google
.
datastore
.
v1
.
IRunQueryRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IRunQueryRequest
options
CallOptions
callback
Callback
<protos. google.datastore.v1.IRunQueryResponse
, protos. google.datastore.v1.IRunQueryRequest
| null | undefined, {} | null | undefined>
void
runQuery(request, callback)
runQuery
(
request
:
protos
.
google
.
datastore
.
v1
.
IRunQueryRequest
,
callback
:
Callback<protos
.
google
.
datastore
.
v1
.
IRunQueryResponse
,
protos
.
google
.
datastore
.
v1
.
IRunQueryRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.datastore.v1.IRunQueryRequest
callback
Callback
<protos. google.datastore.v1.IRunQueryResponse
, protos. google.datastore.v1.IRunQueryRequest
| null | undefined, {} | null | undefined>
void