Request class for the Query operation.

### Type parameters

- #### T

### Hierarchy

- ReadManyRequest<T, QueryInput, QueryOutput, QueryResponse<T>, QueryRequest<T>>
  - QueryRequest

## Index

### Constructors

- constructor

### Properties

- dynamoDBWrapper
- logger
- metadata
- modelClazz
- params
- secondaryIndex
- tableName
- INFINITE_LIMIT

### Methods

- ascending
- descending
- doRequest
- exclusiveStartKey
- exec
- execCount
- execFetchAll
- execFullResponse
- execNoMap
- execSingle
- index
- limit
- mapFromDb
- returnConsumedCapacity
- where
- whereAttribute
- wherePartitionKey
- whereSortKey

## Constructors

### constructor

- new QueryRequest(dynamoDBWrapper: DynamoDbWrapper, modelClazz: ModelConstructor<T>): QueryRequest

- Overrides ReadManyRequest.constructor

  - Defined in dynamo/request/query/query.request.ts:23

  #### Parameters

  - ##### dynamoDBWrapper: DynamoDbWrapper

  - ##### modelClazz: ModelConstructor<T>

  #### Returns QueryRequest

## Properties

### dynamoDBWrapper

dynamoDBWrapper: DynamoDbWrapper

Inherited from BaseRequest.dynamoDBWrapper

- Defined in dynamo/request/base.request.ts:29

### Protected logger

logger: Logger

Overrides ReadManyRequest.logger

- Defined in dynamo/request/query/query.request.ts:23

### metadata

metadata: Metadata<T>

Inherited from BaseRequest.metadata

- Defined in dynamo/request/base.request.ts:39

metadata created from modelClazz

### modelClazz

modelClazz: ModelConstructor<T>

Inherited from BaseRequest.modelClazz

- Defined in dynamo/request/base.request.ts:34

corresponding Model Class

### params

params: QueryInput

Inherited from BaseRequest.params

- Defined in dynamo/request/base.request.ts:49

request input object

### Protected Optional secondaryIndex

secondaryIndex: SecondaryIndex<T>

Inherited from ReadManyRequest.secondaryIndex

- Defined in dynamo/request/read-many.request.ts:39

### tableName

tableName: string

Inherited from BaseRequest.tableName

- Defined in dynamo/request/base.request.ts:44

tableName created with configured tableNameResolver function

### Static INFINITE_LIMIT

INFINITE_LIMIT: number = -1

Inherited from ReadManyRequest.INFINITE_LIMIT

- Defined in dynamo/request/read-many.request.ts:37

Infinite limit will remove the Limit param from request params when calling ReadManyRequest.limit(ReadManyRequest.INFINITE_LIMIT)

## Methods

### ascending

- ascending(): QueryRequest<T>

- - Defined in dynamo/request/query/query.request.ts:68

  #### Returns QueryRequest<T>

### descending

- descending(): QueryRequest<T>

- - Defined in dynamo/request/query/query.request.ts:73

  #### Returns QueryRequest<T>

### Protected doRequest

- doRequest(params: QueryInput): Promise<QueryOutput>

- Overrides ReadManyRequest.doRequest

  - Defined in dynamo/request/query/query.request.ts:78

  #### Parameters

  - ##### params: QueryInput

  #### Returns Promise<QueryOutput>

### exclusiveStartKey

- exclusiveStartKey(key: DynamoDB.Key | null): QueryRequest<T>

- Inherited from ReadManyRequest.exclusiveStartKey

  - Defined in dynamo/request/read-many.request.ts:57

  #### Parameters

  - ##### key: DynamoDB.Key | null

    A map representing the start id which is included in next call, if null is delivered startKey will be removed from params

  #### Returns QueryRequest<T>

### exec

- exec(): Promise<T[]>

- Inherited from ReadManyRequest.exec

  Overrides BaseRequest.exec

  - Defined in dynamo/request/read-many.request.ts:171

  execute request and return the parsed items

  #### Returns Promise<T[]>

### execCount

- execCount(): Promise<number>

- Inherited from ReadManyRequest.execCount

  - Defined in dynamo/request/read-many.request.ts:153

  Execute with Select: 'Count' to count the items.

  #### Returns Promise<number>

### execFetchAll

- execFetchAll(): Promise<T[]>

- Inherited from ReadManyRequest.execFetchAll

  - Defined in dynamo/request/read-many.request.ts:194

  fetches all pages. may uses all provisionedOutput, therefore for client side use cases rather use pagedDatasource (exec)

  #### Returns Promise<T[]>

### execFullResponse

- execFullResponse(): Promise<QueryResponse<T>>

- Inherited from ReadManyRequest.execFullResponse

  Overrides BaseRequest.execFullResponse

  - Defined in dynamo/request/read-many.request.ts:183

  execute request and return the full response with the parsed items

  #### Returns Promise<QueryResponse<T>>

### execNoMap

- execNoMap(): Promise<O>

- Inherited from ReadManyRequest.execNoMap

  - Defined in dynamo/request/read-many.request.ts:124

  execute the request and return the raw response (without parsing the attributes to js objects)

  #### Returns Promise<O>

### execSingle

- execSingle(): Promise<T | null>

- Inherited from ReadManyRequest.execSingle

  - Defined in dynamo/request/read-many.request.ts:133

  Execute with Limit: 1 to read the first item only

  #### Returns Promise<T | null>

### index

- index(indexName: string): QueryRequest<T>

- Inherited from ReadManyRequest.index

  - Defined in dynamo/request/read-many.request.ts:71

  query items on the given index.

  #### Parameters

  - ##### indexName: string

  #### Returns QueryRequest<T>

### limit

- limit(limit: number): QueryRequest<T>

- Inherited from ReadManyRequest.limit

  - Defined in dynamo/request/read-many.request.ts:86

  set Limit to params - The maximum number of items to evaluate (not necessarily the number of matching items)

  #### Parameters

  - ##### limit: number

  #### Returns QueryRequest<T>

### Protected mapFromDb

- mapFromDb(output: QueryOutput): Z

- Inherited from ReadManyRequest.mapFromDb

  - Defined in dynamo/request/read-many.request.ts:198

  #### Parameters

  - ##### output: QueryOutput

  #### Returns Z

### returnConsumedCapacity

- returnConsumedCapacity(level: DynamoDB.ReturnConsumedCapacity): ReadManyRequest<T, QueryInput, QueryOutput, QueryResponse<T>, QueryRequest<T>>

- Inherited from BaseRequest.returnConsumedCapacity

  - Defined in dynamo/request/base.request.ts:75

  return ConsumedCapacity of the corresponding table(s) in the response

  #### Parameters

  - ##### level: DynamoDB.ReturnConsumedCapacity

    not all requests support all values

  #### Returns ReadManyRequest<T, QueryInput, QueryOutput, QueryResponse<T>, QueryRequest<T>>

### where

- where(...conditionDefFns: ConditionExpressionDefinitionFunction[]): QueryRequest<T>

- Inherited from ReadManyRequest.where

  - Defined in dynamo/request/read-many.request.ts:115

  add one or multiple conditions.

  example

    req.where( attribute('age').eq(23) )

  example

    req.where( or( attribute('age').lt(18), attribute('age').gt(65) ) )

  #### Parameters

  - ##### Rest ...conditionDefFns: ConditionExpressionDefinitionFunction[]

  #### Returns QueryRequest<T>

### whereAttribute

- whereAttribute<K>(attributePath: K): RequestConditionFunctionTyped<QueryRequest<T>, T, K>
- whereAttribute(attributePath: string): RequestConditionFunction<QueryRequest<T>, T>

- Inherited from ReadManyRequest.whereAttribute

  - Defined in dynamo/request/read-many.request.ts:104

  add a condition for propertyPath

  example

    req.whereAttribute('path.to.prop').eq('value')

  #### Type parameters

  - #### K: keyof T

  #### Parameters

  - ##### attributePath: K

  #### Returns RequestConditionFunctionTyped<QueryRequest<T>, T, K>

- Inherited from ReadManyRequest.whereAttribute

  - Defined in dynamo/request/read-many.request.ts:105

  #### Parameters

  - ##### attributePath: string

  #### Returns RequestConditionFunction<QueryRequest<T>, T>

### wherePartitionKey

- wherePartitionKey(partitionKeyValue: any): QueryRequest<T>

- - Defined in dynamo/request/query/query.request.ts:33

  #### Parameters

  - ##### partitionKeyValue: any

  #### Returns QueryRequest<T>

### whereSortKey

- whereSortKey(): SortKeyConditionFunction<QueryRequest<T>>

- - Defined in dynamo/request/query/query.request.ts:50

  used to define some condition for the sort key, use the secondary index to query based on a custom index

  #### Returns SortKeyConditionFunction<QueryRequest<T>>