Send feedback
Class DatastoreRequest Stay organized with collections
Save and categorize content based on your preferences.
Version 6.5.0 keyboard_arrow_down
Handle logic for Datastore API operations. Handles request logic for Datastore.
Creates requests to the Datastore endpoint. Designed to be inherited by the Datastore
and Transaction
classes.
Package
@google-cloud/datastore
Properties
datastore
Property Value
id
id
:
string
|
undefined
;
Property Value
requestCallbacks_
requestCallbacks_
:
Array
< (
err
:
Error
|
null
,
resp
:
Entity
|
null
)
=
>
void
>
|
Entity
;
Property Value
requests_
requests_
:
Entity
|
{
mutations
:
Array
< {}>;
};
Property Value
Methods
allocateIds(key, options)
allocateIds
(
key
:
entity
.
Key
,
options
:
AllocateIdsOptions
|
number
)
:
Promise<AllocateIdsResponse>
;
Parameters Name
Description
key
entity.Key
options
AllocateIdsOptions
| number
Returns
allocateIds(key, options, callback)
allocateIds
(
key
:
entity
.
Key
,
options
:
AllocateIdsOptions
|
number
,
callback
:
AllocateIdsCallback
)
:
void
;
Parameters Name
Description
key
entity.Key
options
AllocateIdsOptions
| number
callback
AllocateIdsCallback
Returns
createReadStream(keys, options)
createReadStream
(
keys
:
Entities
,
options
?:
CreateReadStreamOptions
)
:
Transform
;
Retrieve the entities as a readable object stream.
Parameters Name
Description
keys
Entities
Datastore key object(s).
options
CreateReadStreamOptions
Optional configuration. See for a complete list of options.
Returns
delete(keys, gaxOptions)
delete
(
keys
:
Entities
,
gaxOptions
?:
CallOptions
)
:
Promise<DeleteResponse>
;
Parameters
Returns
delete(keys, callback)
delete
(
keys
:
Entities
,
callback
:
DeleteCallback
)
:
void
;
Parameters
Returns
delete(keys, gaxOptions, callback)
delete
(
keys
:
Entities
,
gaxOptions
:
CallOptions
,
callback
:
DeleteCallback
)
:
void
;
Parameters
Returns
get(keys, options)
get
(
keys
:
entity
.
Key
|
entity
.
Key
[],
options
?:
CreateReadStreamOptions
)
:
Promise<GetResponse>
;
Parameters Name
Description
keys
entity.Key
| entity.Key
[]
options
CreateReadStreamOptions
Returns
get(keys, callback)
get
(
keys
:
entity
.
Key
|
entity
.
Key
[],
callback
:
GetCallback
)
:
void
;
Parameters Name
Description
keys
entity.Key
| entity.Key
[]
callback
GetCallback
Returns
get(keys, options, callback)
get
(
keys
:
entity
.
Key
|
entity
.
Key
[],
options
:
CreateReadStreamOptions
,
callback
:
GetCallback
)
:
void
;
Parameters Name
Description
keys
entity.Key
| entity.Key
[]
options
CreateReadStreamOptions
callback
GetCallback
Returns
merge(entities)
merge
(
entities
:
Entities
)
:
Promise<CommitResponse>
;
Parameter
Returns
merge(entities, callback)
merge
(
entities
:
Entities
,
callback
:
SaveCallback
)
:
void
;
Parameters
Returns
prepareGaxRequest_(config, callback)
prepareGaxRequest_
(
config
:
RequestConfig
,
callback
:
Function
)
:
void
;
Parameters
Returns
request_(config, callback)
request_
(
config
:
RequestConfig
,
callback
:
RequestCallback
)
:
void
;
Parameters
Returns
requestStream_(config)
requestStream_
(
config
:
RequestConfig
)
:
AbortableDuplex
;
Make a request as a stream.
Parameter Name
Description
config
RequestConfig
Configuration object.
Returns
runQuery(query, options)
runQuery
(
query
:
Query
,
options
?:
RunQueryOptions
)
:
Promise<RunQueryResponse>
;
Parameters
Returns
runQuery(query, options, callback)
runQuery
(
query
:
Query
,
options
:
RunQueryOptions
,
callback
:
RunQueryCallback
)
:
void
;
Parameters
Returns
runQuery(query, callback)
runQuery
(
query
:
Query
,
callback
:
RunQueryCallback
)
:
void
;
Parameters
Returns
runQueryStream(query, options)
runQueryStream
(
query
:
Query
,
options
?:
RunQueryStreamOptions
)
:
Transform
;
Get a list of entities as a readable object stream.
See for a list of all available options.
Parameters Name
Description
query
Query
Query object.
options
RunQueryStreamOptions
Optional configuration.
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-04 UTC.
Need to tell us more?
[[["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-09-04 UTC."],[],[],null,[]]