Skip to content

Commit 65b8f17

Browse files
docs(snippets): const for gsi name, comment in put
1 parent 7e97c85 commit 65b8f17

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { Model, GSIPartitionKey, GSISortKey } from '@shiftcoders/dynamo-easy'
22

3+
const MY_MODEL_GSI = 'NameOfGSI'
4+
35
@Model()
46
class MyModel {
5-
@GSIPartitionKey('NameOfGSI')
7+
@GSIPartitionKey(MY_MODEL_GSI)
68
myGsiPartitionKey: string
79

8-
@GSISortKey('NameOfGSI')
10+
@GSISortKey(MY_MODEL_GSI)
911
myGsiSortKey: number
1012
}

snippets/store-requests/put.snippet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const objectToPut: Person = {
55
id: 'vogelsw',
66
name: 'Werner Hans Peter Vogels',
77
yearOfBirth: 1958,
8-
}
8+
} // object literal or new Person(...)
99

1010
new DynamoStore(Person)
1111
.put(objectToPut)

0 commit comments

Comments
 (0)