Stay organized with collections Save and categorize content based on your preferences.
Build a Query object.
**Queries are built with {module:datastore#createQuery} and .**
Package@google-cloud/datastore Constructors (constructor)(scope, kinds)constructor(scope?: Datastore | Transaction, kinds?: string[] | null);
Constructs a new instance of the Query
class
Datastore | Transaction
string[] | null
constructor(scope?: Datastore | Transaction, namespace?: string | null, kinds?: string[]);
Constructs a new instance of the Query
class
Datastore | Transaction
string | null
string[]
endVal: string | Buffer | null;
Property Value Type Description string | Buffer | null filters Property Value Type Description Filter[] groupByVal Property Value Type Description Array<{}> kinds Property Value Type Description string[] limitVal Property Value namespace
namespace?: string | null;
Property Value Type Description string | null offsetVal Property Value orders Property Value scope
scope?: Datastore | Transaction;
Property Value Type Description Datastore | Transaction selectVal Property Value Type Description Array<{}> startVal
startVal: string | Buffer | null;
Property Value Type Description string | Buffer | null Methods end(end)
end(end: string | Buffer): this;
Parameter Name Description end string | Buffer
{Query}
filter(property, value)filter(property: string, value: {}): Query;
Parameters Name Description property string
{}
filter(property: string, operator: Operator, value: {}): Query;
Parameters Name Description property string
Operator
{}
groupBy(fieldNames: string | string[]): this;
Group query results by a list of properties.
Parameter Name Description fieldNamesstring | string[]
{Query}
hasAncestor(key)hasAncestor(key: Key): this;
Parameter Name Description key Key
Key object to filter by.
Returns Type Description this{Query}
limit(n) Parameter Name Description nnumber
The number of results to limit the query to.
Returns Type Description this{Query}
offset(n) Parameter Name Description nnumber
The offset to start from after the start cursor.
Returns Type Description this{Query}
order(property, options)order(property: string, options?: OrderOptions): this;
Sort the results by a property name in ascending or descending order. By default, an ascending sort order will be used.
Parameters Name Description propertystring
The property to order by.
optionsOrderOptions
Options object.
Returns Type Description this{Query}
run(options)run(options?: RunQueryOptions): Promise<RunQueryResponse>;
Parameter Name Description options RunQueryOptions
run(options: RunQueryOptions, callback: RunQueryCallback): void;
Parameters Name Description options RunQueryOptions
RunQueryCallback
run(callback: RunQueryCallback): void;
Parameter Name Description callback RunQueryCallback
runStream(options?: RunQueryStreamOptions): import("stream").Transform;
Run the query as a readable object stream.
Query#runStream
Parameter Name Description optionsRunQueryStreamOptions
Optional configuration. See for a complete list of options.
Returns Type Description import("stream").internal.Transform{stream}
select(fieldNames)select(fieldNames: string | string[]): this;
Retrieve only select properties from the matched entities.
Queries that select a subset of properties are called Projection Queries.
Parameter Name Description fieldNamesstring | string[]
Properties to return from the matched entities.
Returns Type Description this{Query}
start(start)start(start: string | Buffer): this;
Parameter Name Description start string | Buffer
{Query}
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-08-07 UTC.
[[["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."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4