-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ts
29 lines (24 loc) · 1.04 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { DynamoDBClient } from "@aws-sdk/client-dynamodb"
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb"
export const ddbClient = new DynamoDBClient({
region: 'ap-southeast-1',
endpoint: 'http://localhost:65000',
credentials: {
accessKeyId: 'dummy',
secretAccessKey: 'dummy',
}
})
const marshallOptions = {
// Whether to automatically convert empty strings, blobs, and sets to `null`.
convertEmptyValues: false, // false, by default.
// Whether to remove undefined values while marshalling.
removeUndefinedValues: false, // false, by default.
// Whether to convert typeof object to map attribute.
convertClassInstanceToMap: false, // false, by default.
};
const unmarshallOptions = {
// Whether to return numbers as a string instead of converting them to native JavaScript numbers.
wrapNumbers: false, // false, by default.
};
const translateConfig = { marshallOptions, unmarshallOptions };
export const ddbDocClient = DynamoDBDocumentClient.from(ddbClient, translateConfig)