Class: Google::Cloud::Datastore::V1::Query

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/datastore/v1/query.rb

Overview

A query for entities.

The query stages are executed in the following order:

  1. kind
  2. filter
  3. projection
  4. order + start_cursor + end_cursor
  5. offset
  6. limit
  7. find_nearest

Instance Attribute Summary collapse

Instance Attribute Details

#distinct_on::Array<::Google::Cloud::Datastore::V1::PropertyReference>

Returns The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

Returns:

  • (::Array<::Google::Cloud::Datastore::V1::PropertyReference>)

    The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

    Requires:

    • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.


141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#end_cursor::String

An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query.

Returns:



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#filter::Google::Cloud::Datastore::V1::Filter

Returns The filter to apply.

Returns:



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#find_nearest::Google::Cloud::Datastore::V1::FindNearest

Returns Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

Returns:



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#kind::Array<::Google::Cloud::Datastore::V1::KindExpression>

Returns The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

Returns:



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#limit::Google::Protobuf::Int32Value

Returns The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

Returns:

  • (::Google::Protobuf::Int32Value)

    The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#offset::Integer

Returns The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

Returns:

  • (::Integer)

    The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#order::Array<::Google::Cloud::Datastore::V1::PropertyOrder>

Returns The order to apply to the query results (if empty, order is unspecified).

Returns:



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#projection::Array<::Google::Cloud::Datastore::V1::Projection>

Returns The projection to return. Defaults to returning all properties.

Returns:



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end

#start_cursor::String

A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query.

Returns:



141
142
143
144
# File 'proto_docs/google/datastore/v1/query.rb', line 141

class Query
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods
end