Skip to main content
Module

x/google_datastore/query.ts>Query

A set of APIs that allow interfacing to Google Datastore on GCP from Deno.
Go to Latest
class Query
import { Query } from "https://deno.land/x/google_datastore@0.0.14/query.ts";

A class which abstracts the native Google Datastore Query interface and provides a fluent interface for building a query.

Constructors

new
Query(kind?: string | string[], partition?: PartitionId)

Methods

end(cursor: string | ArrayBufferView): this

Provide an end cursor for the query.

filter(property: string, value: unknown): this

Filter the results where the supplied property equals the value.

To filter by ancestors see Query.hasAncestor.

filter(
property: string,
value: unknown,
): this

Filter the results where the supplied property matches the operator.

The operators "=", "<", ">", "<=", and ">=" are supported. To filter by ancestors see Query.hasAncestor.

groupBy(fieldNames: string | string[]): this

Group query results by a list of properties.

hasAncestor(key: Key): this

Filter query by ancestors.

limit(limit: number): this

Limit the number of results returned.

offset(offset: number): this

Start returning results after the offset, the value must be > 1.

order(property: string, descending?: boolean): this

Sort the results by a property name in ascending or descending order.

By default, the results will be in ascending order. Set descending to true to sort in descending order.

select(fieldNames: string | string[]): this

Retrieve only select properties from the matched entities.

start(cursor: string | ArrayBufferView): this

Set a start cursor for the query.