In this video, we are going to describing existing Dynamo DB tables with using the Dynamo DB packets.
In order to do that, please open the our visual code and I have created separate lecture folder in
here and follow the same steps.
What we have done in the last videos is remember that we have installed required DB packets and create
dynamo db client separate Node.js module and now we will develop our actual code into the describing
tables command.
So for that purpose or for that purpose, I have create describe table JavaScript file and create a
run method with the basic implementation.
As you remember, that is the structure of our implementation.
We will make our call in this two step.
So before this step I would like to search for the describe table command.
In our API reference documentation, you can come to the dynamic DB client object and search for the
describe table command.
If you click these describe table command, we can see the import statement in here.
We will import dynamo DB, describe table command and this is the usage.
And we can also see how we can send input parameters and get the outputs in these objects.
Please click the describe table command input and see that we should provide the table name as a property
of this command.
So I'm going to send the request for the describe table command and send the table name as a parameter
of this command.
So please open the OR we just record and come to implementation part.
Now we are going to implement our logic, which is the sending request to the describe table command.
In order to do that, I'm going to copy and paste this line of code.
This is the or core line of the code which basically using the client object and assigned the describe
table command.
So let's record import statements in our application, okay?
If you come this line of code and come to control space and click the first result, you can see that
we have successfully import describe table command from the our dynamic DB SDK and it's the same way
we should import dynamo DB client module which comes from the our.
Object.
You can see in here.
I have saved the file and come here and again put the input statement, click that JS file.
Okay, very good.
Now we have imported required statement and it is time to invoke these.
Describe table command.
Please open the terminal and go to correct folder structure and run the node command.
So I'm going to run the node.
Scrap table.
JS So hit the answer and see the result.
So as you can see that we've got the parameters we have to add the parameters for our case parameters
should be include a table name for that purpose before running the our method.
Come here and create a parameters object in here.
And we basically placing the table name.
Our table name is order.
So after defining the parameters, we passing the parameters to the described table command.
If you come to our terminal and run our node command again.
See that this time we will get describing documentation of the table or table definition and all properties,
including in this JSON file that we can successfully run.
Describe command and get back response from the Dynamo DB.