ds_wrapper v0.1.1 DsWrapper.Query View Source

GoogleApi.Datastore.V1.Model.Query wrapper

Link to this section Summary

Functions

Set a limit on the number of results to be returned.

Create a new %GoogleApi.Datastore.V1.Model.Query for kind.

Sort the results by a property name. By default, an ascending sort order will be used. To sort in descending order, provide a second argument to :desc.

Set the cursor to start the results at.

Add a property filter to the query.

Link to this section Types

Link to this type

query()

View Source
query() :: %GoogleApi.Datastore.V1.Model.Query{
  distinctOn: term(),
  endCursor: term(),
  filter: term(),
  kind: term(),
  limit: term(),
  offset: term(),
  order: term(),
  projection: term(),
  startCursor: term()
}

Link to this section Functions

Set a limit on the number of results to be returned.

Examples

iex> import DsWrapper.Query
iex> new_query("SomeKind")
...> |> limit(100)
%GoogleApi.Datastore.V1.Model.Query{...}
Link to this function

new_query(kind)

View Source
new_query(String.t()) :: %GoogleApi.Datastore.V1.Model.Query{
  distinctOn: term(),
  endCursor: term(),
  filter: term(),
  kind: term(),
  limit: term(),
  offset: term(),
  order: term(),
  projection: term(),
  startCursor: term()
}

Create a new %GoogleApi.Datastore.V1.Model.Query for kind.

Examples

iex> DsWrapper.Query.new_query("SomeKind")
%GoogleApi.Datastore.V1.Model.Query{...}
Link to this function

order(query, property, direction \\ nil)

View Source
order(query(), String.t(), :asc | :desc | nil) :: query()

Sort the results by a property name. By default, an ascending sort order will be used. To sort in descending order, provide a second argument to :desc.

Examples

iex> import DsWrapper.Query
iex> new_query("SomeKind")
...> |> order("some_property")
%GoogleApi.Datastore.V1.Model.Query{...}
Link to this function

start(query, cursor)

View Source
start(query(), String.t()) :: query()

Set the cursor to start the results at.

Examples

iex> import DsWrapper.Query
iex> new_query("SomeKind")
...> |> start(cursor)
%GoogleApi.Datastore.V1.Model.Query{...}
Link to this function

where(query, property, operator, value)

View Source
where(query(), String.t(), String.t(), term()) :: query()

Add a property filter to the query.

Examples

iex> import DsWrapper.Query
iex> new_query("SomeKind")
...> |> where("some_property", "=", "some value")
%GoogleApi.Datastore.V1.Model.Query{...}