Skip to content

Commit 01a6ced

Browse files
committed
update java migration guide snippet
1 parent 4eb5fb7 commit 01a6ced

File tree

1 file changed

+5
-8
lines changed
  • website/docs/clients/migration-guides

1 file changed

+5
-8
lines changed

website/docs/clients/migration-guides/index.mdx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,11 @@ BatchWriteParams batchParams = new BatchWriteParams();
293293
List<BatchOperation> requests = new ArrayList<>();
294294

295295
for (Map<String, Object> record : records) {
296-
BatchOperation request = new BatchOperation();
297-
Map<String, String> body = new HashMap<>();
298-
299-
request.setAction("addObject");
300-
// Accepts a free form `Map<String, Object>`.
301-
request.setBody(record);
302-
303-
requests.add(request);
296+
requests.add(new BatchOperation()
297+
.setAction(Action.ADD_OBJECT)
298+
// Accepts a free form `Map<String, Object>`.
299+
.setBody(record)
300+
);
304301
}
305302

306303
batchParams.setRequests(requests);

0 commit comments

Comments
 (0)