1
00:00:00,240 --> 00:00:06,540
In this video, we are going to write data into dynamic DB table with using a commands.

2
00:00:06,570 --> 00:00:10,470
In this step we will insert several items into our order table.

3
00:00:10,470 --> 00:00:15,660
So as you can see the image we are in the second use case, which is the right data in the table.

4
00:00:15,900 --> 00:00:18,930
So for that purpose please open the pseudocode.

5
00:00:18,930 --> 00:00:24,510
I have created a separate lecture and put the required commands in this command text file.

6
00:00:24,600 --> 00:00:31,440
So basically we will do select commands for writing data in dynamic DV table and a double cell example

7
00:00:31,440 --> 00:00:37,200
for creating a new item into our order table using the put item command.

8
00:00:38,010 --> 00:00:38,640
Okay.

9
00:00:38,640 --> 00:00:43,110
So if you scroll down, you can see the commands regarding the operating system.

10
00:00:43,110 --> 00:00:44,070
This is the Mac.

11
00:00:44,070 --> 00:00:50,910
We are inserting two items and four windows at the same way we are inserting two same items.

12
00:00:50,910 --> 00:00:58,200
So if we follow the commands, we are using the SLA and we are using the item command to perform adding

13
00:00:58,200 --> 00:01:01,650
item into existing table, which table name is a order?

14
00:01:01,650 --> 00:01:03,960
And we can specify the item in here.

15
00:01:03,960 --> 00:01:07,380
As you can see that we can specify the item is a JSON format.

16
00:01:07,380 --> 00:01:12,300
So in the JSON format it should required the partition key and sort K.

17
00:01:12,300 --> 00:01:19,020
So we set the partition key as a ID and we are providing the number one and we also set that status

18
00:01:19,050 --> 00:01:21,090
is a string and in-progress.

19
00:01:21,090 --> 00:01:27,120
So we can also add some additional attributes like description which is a string iPhone order.

20
00:01:27,120 --> 00:01:31,170
And also we can add the order date as a string and date information.

21
00:01:31,170 --> 00:01:33,120
So it's the same format we are adding.

22
00:01:33,120 --> 00:01:38,430
One more item, the ID partition key is the same, but this time status is different, which is the

23
00:01:38,430 --> 00:01:39,150
delivery.

24
00:01:39,150 --> 00:01:45,300
And you can see the description and the order date also different from the first item.

25
00:01:45,300 --> 00:01:50,430
So I'm going to add this item one by one in the Windows operating system.

26
00:01:50,430 --> 00:01:56,460
So that's why I'm going to copy this line of code and paste into our terminal and hit enter.

27
00:01:57,480 --> 00:01:57,750
Okay.

28
00:01:57,840 --> 00:02:04,230
That was a problem when we are running the PowerShell commands because if you check the in item object,

29
00:02:04,260 --> 00:02:07,320
we are passing the JSON input in here.

30
00:02:07,320 --> 00:02:13,650
So when we are trying to JSON input with using the PowerShell command, it is required two times double

31
00:02:13,650 --> 00:02:14,010
code.

32
00:02:14,010 --> 00:02:22,020
You can see in here I input all inputs, JSON values two times double code and after that it will work.

33
00:02:22,020 --> 00:02:25,350
So this is not issue for the Mac computers.

34
00:02:25,350 --> 00:02:33,450
You can work with these commands, but for Windows one, we should put the item value with two times

35
00:02:33,450 --> 00:02:34,110
double code.

36
00:02:34,140 --> 00:02:39,060
Please copy this line of command and paste it in here.

37
00:02:39,180 --> 00:02:40,980
Let me clear first.

38
00:02:40,980 --> 00:02:41,250
Okay.

39
00:02:41,280 --> 00:02:44,850
Now when we are copy our command and paste in here.

40
00:02:44,880 --> 00:02:46,080
Hit enter.

41
00:02:46,380 --> 00:02:49,050
So this time we can manage to put item.

42
00:02:49,050 --> 00:02:53,310
That means insert a new item into our order table dynamo.

43
00:02:53,310 --> 00:02:58,920
DB So I'm going to copy from the second command, which is inserting a second item into our table and

44
00:02:58,920 --> 00:02:59,880
hit enter.

45
00:03:00,510 --> 00:03:08,130
So as we have successfully insert these items to verify that, please open the A management console

46
00:03:08,130 --> 00:03:09,660
and go to tables.

47
00:03:09,750 --> 00:03:13,530
Order explore table items one the scan command.

48
00:03:13,530 --> 00:03:21,780
See that we have two items in sorting successfully, so we will insert these items using the put item

49
00:03:21,780 --> 00:03:23,550
command in this step.

50
00:03:23,550 --> 00:03:30,330
I would like to emphasize that this is important that we can use all these operations with using different

51
00:03:30,330 --> 00:03:30,630
tools.

52
00:03:30,630 --> 00:03:37,860
That means we can insert item with using the management console, cell command SDK package and so on.

53
00:03:37,860 --> 00:03:41,340
All these tools are using the dynamic DB API.

54
00:03:41,370 --> 00:03:46,260
We can see the Amazon Dynamo DB API reference documentation.

55
00:03:46,260 --> 00:03:51,110
You can see in here, basically we will perform put item command.

56
00:03:51,120 --> 00:03:53,010
You can search as a put item.

57
00:03:53,010 --> 00:03:59,010
In our case, we have insert any item we're choosing to put item command and you can see the all details

58
00:03:59,010 --> 00:04:07,440
in here with example requested tags and see the item details that we can provide different formats and

59
00:04:07,440 --> 00:04:09,750
different request description.

60
00:04:09,750 --> 00:04:13,590
So this is the documentation that we are going to use when we are interacting.

61
00:04:13,610 --> 00:04:19,980
Dynamo DB We have lots of Dynamo DB API that we can invoke this API from the console or CLI commands

62
00:04:19,980 --> 00:04:22,020
or SDK commands.

63
00:04:22,410 --> 00:04:28,320
So as you can see that we have successfully write data into Dynamo DB table.

64
00:04:28,320 --> 00:04:31,980
We are using to select commands in the next for video.

65
00:04:32,010 --> 00:04:34,680
I would like to follow the other use cases.

66
00:04:34,680 --> 00:04:40,200
That means we are going to use put item, update item, get item and date item command.

67
00:04:40,200 --> 00:04:46,140
If you understand the idea how we can invoke the shell commands and use the Dynamo DB API, we can skip

68
00:04:46,140 --> 00:04:47,670
the next section.

69
00:04:48,180 --> 00:04:51,900
Otherwise you can continue the course by following the other use cases.
