> For the complete documentation index, see [llms.txt](https://aerocode.gitbook.io/tynamo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aerocode.gitbook.io/tynamo/tynamo-1/create-tynamo/tynamotable/batchgetitem.md).

# batchGetItem

### Spec

```typescript
async batchGetItem(
    tnmInput: TynamoBatchGetItemInput<TSource>
): Promise<TynamoBatchGetItemOutput<TSource>>
```

{% hint style="info" %}
Unlike Dynamo, there is no limit. &#x20;

Internally, they are split properly and processed in parallel.
{% endhint %}

### Input&#x20;

```typescript
export interface TynamoBatchGetItemInput<TSource> {
    RequestItems: Partial<TSource>[];
    
    // Derived from DynamoDB.
    ReturnConsumedCapacity?: ReturnConsumedCapacity;
    ConsistentRead?: ConsistentRead;
    ProjectionExpression?: ProjectionExpression;
    ExpressionAttributeNames?: ExpressionAttributeNameMap;
}
```

| Name         | Type                       | Info                         |
| ------------ | -------------------------- | ---------------------------- |
| RequestItems | `Partial<@DynamoEntity>[]` | Primary key of item to read. |

{% hint style="info" %}
Unlisted param is derived from `DynamoDB`.

Check [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html) for more information.
{% endhint %}

### Output

```typescript
export interface TynamoBatchGetItemOutput<TSource> {
    Responses?: TSource[];
    UnprocessedKeys?: Partial<TSource>[];

    // Derived from DynamoDB.
    $response?: Response<BatchGetItemOutput, AWSError>;
    ConsumedCapacity?: ConsumedCapacityMultiple;
}
```

| Name            | Type                       | Info                            |
| --------------- | -------------------------- | ------------------------------- |
| Responses       | `@DynamoEntity[]`          | Result of `batchGet` operation. |
| UnprocessedKeys | `Partial<@DynamoEntity>[]` | Primary key of failed item.     |

{% hint style="info" %}
Unlisted param is derived from `DynamoDB`.

Check [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html) for more information.
{% endhint %}

### Example

```typescript
@DynamoEntity()
class Cat {
    @DynamoProperty({ keyType: KeyType.hash })
    id!: number;

    @DynamoProperty({ keyType: KeyType.attr })
    name!: string;

    constructor(id: number, name: string) {
        this.id = id;
        this.name = name;
    }
}

const tynamo: Tynamo = new Tynamo({
    region: "ap-northeast-2",
    endpoint: "http://localhost:8000"
});
const tynamoTable = tynamo.getTableOf(Cat);

const cats: Cat[] = [];
for(let i=0; i<100; i++){
    cats.push(new Cat(i, ""));
}

await tynamoTable.batchGetItem({
    RequestItems: cats
});


```
