File tree 1 file changed +1
-29
lines changed
1 file changed +1
-29
lines changed Original file line number Diff line number Diff line change 3
3
4
4
* Feature - Add support for atomic counter (#144 )
5
5
6
- 2.7.0 (master )
6
+ 2.7.0 (2021-10-28 )
7
7
------------------
8
8
9
9
* Feature - Implement the ` BatchWriteItem ` operation (#119 )
10
10
11
- #### BatchWriteItem Example
12
-
13
- ``` ruby
14
- class Breakfast
15
- include Aws ::Record
16
- integer_attr :id , hash_key: true
17
- string_attr :name , range_key: true
18
- string_attr :body
19
- end
20
-
21
- # save something to DynamoDB so we can delete it later in a batch request
22
- eggs = Breakfast .new (id: 1 , name: " eggs" ).save!
23
- # we're going to create the following items in a batch request
24
- waffles = Breakfast .new (id: 2 , name: " waffles" )
25
- pancakes = Breakfast .new (id: 3 , name: " pancakes" )
26
-
27
- # perform a batch operation
28
- operation = Aws ::Record ::Batch .write(client: Breakfast .dynamodb_client) do |db |
29
- db.put(waffles)
30
- db.delete(eggs)
31
- db.put(pancakes)
32
- end
33
-
34
- # (optional) - unprocessed items can be retried
35
- # note: it's a good idea to implement a custom/exponential backoff strategy
36
- operation.execute! unless operation.complete?
37
- ```
38
-
39
11
2.6.1 (2021-08-10)
40
12
------------------
41
13
You can’t perform that action at this time.
0 commit comments