Book Image

Mastering DynamoDB

By : Tanmay Deshpande
Book Image

Mastering DynamoDB

By: Tanmay Deshpande

Overview of this book

Table of Contents (18 chapters)
Mastering DynamoDB
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
8
Useful Libraries and Tools
Index

Query and scan operations


The query operation is a very important operation that allows us to fetch specific items from the given table. It needs a primary input and an optional start key to compare with the list of items. The query fetches all matching entries to the input from a given table. You can also use comparison operations, such as greater than, less than, contains, between, and so on to narrow down the result set. Data returned from a query or scan operation is limited to 1 MB. If it does not find any matching items with respect to a given input key, it returns an empty set.

Query results are always sorted in the order of the range key value. By default, the order of sorting is ascending. If a table has secondary index, then the query operation can be performed on it as well.

The scan operation checks every individual item for a given table. We can specify the filter criteria in order to manage the search results after the scan gets completed. A scan filter normally consists of the...