Module: Aws::Record::Query::QueryClassMethods
- Included in:
- Aws::Record
- Defined in:
- lib/aws-record/record/query.rb
Instance Method Summary collapse
-
#build_query ⇒ Object
This method allows you to build a query using the BuildableSearch DSL.
-
#build_scan ⇒ Object
This method allows you to build a scan using the BuildableSearch DSL.
-
#query(opts) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#query, populating the
:table_name
parameter from the model class, and combining this with the other parameters you provide. -
#scan(opts = {}) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#scan, populating the
:table_name
parameter from the model class, and combining this with the other parameters you provide.
Instance Method Details
#build_query ⇒ Object
This method allows you to build a query using the BuildableSearch DSL.
108 109 110 111 112 113 |
# File 'lib/aws-record/record/query.rb', line 108 def build_query BuildableSearch.new( operation: :query, model: self ) end |
#build_scan ⇒ Object
This method allows you to build a scan using the BuildableSearch DSL.
134 135 136 137 138 139 |
# File 'lib/aws-record/record/query.rb', line 134 def build_scan BuildableSearch.new( operation: :scan, model: self ) end |
#query(opts) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#query, populating the :table_name
parameter from the model class, and combining this with the other parameters you provide.
50 51 52 53 |
# File 'lib/aws-record/record/query.rb', line 50 def query(opts) query_opts = opts.merge(table_name: table_name) ItemCollection.new(:query, query_opts, self, dynamodb_client) end |
#scan(opts = {}) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#scan, populating the :table_name
parameter from the model class, and combining this with the other parameters you provide.
88 89 90 91 |
# File 'lib/aws-record/record/query.rb', line 88 def scan(opts = {}) scan_opts = opts.merge(table_name: table_name) ItemCollection.new(:scan, scan_opts, self, dynamodb_client) end |