Adding New Data to your DynamoDB Database

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ค. 2024
  • In the last video we learnt how we can get data from an AWS DynamoDB table. in this video we're going to learn how we can add new data to that same table.
    By the end of the video you'll know how to:
    - add data to a dynamoDB table
    - set up a POST endpoint in Serverless
    - test POST endpoints using Postman
    Code available at
    github.com/SamWSoftware/Serve...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 50

  • @wsl4532
    @wsl4532 5 หลายเดือนก่อน

    nice tutorial of serverless programming, oorganizied, and easy to learn, good work! thank you !

  • @vikasthakur910
    @vikasthakur910 4 ปีที่แล้ว +7

    I watched many tutorials for AWS serverless on udemy and TH-cam. But I found the real stuff here on your channel. Well explain and plenty of hands on . Thanks a lot making this and sharing your valuable knowledge with us.

    • @CompleteCoding
      @CompleteCoding  4 ปีที่แล้ว

      Thanks Vikas! really glad that you find it so helpful!

    • @vinodshalgar
      @vinodshalgar 3 ปีที่แล้ว

      exactly

  • @alanmangroo3656
    @alanmangroo3656 3 ปีที่แล้ว +1

    Thank you! I have followed your tutorial to build my own Serverless API to log data from my air quality sensor.

    • @CompleteCoding
      @CompleteCoding  3 ปีที่แล้ว

      Awesome, that sounds like a really cool project. Well done!

  • @adrianjason13
    @adrianjason13 4 ปีที่แล้ว

    This series of DynamoDB and Lambda API content is excellent and helpful to me. Consider creating a playlist for this in order of how the whole project was completed.

    • @CompleteCoding
      @CompleteCoding  4 ปีที่แล้ว +1

      Thanks Adrian, there actually is. On my channel it is the serverless framework play list

  • @fenixw05
    @fenixw05 3 ปีที่แล้ว

    I really like the way you teach , thanks so much

  • @saimanish3385
    @saimanish3385 3 ปีที่แล้ว +1

    Hello sir iam a big fan of u. I will be following ur channel for serverless tutorials. Plz make more videos on serverless offline.Most of us are facing problems with debugging the code.
    So plz help us all with more serverless offline videos

    • @CompleteCoding
      @CompleteCoding  3 ปีที่แล้ว

      I'm working on a video on serverless offline debugging right now!

  • @davidbaulina3434
    @davidbaulina3434 3 ปีที่แล้ว

    Great tuts. Keep up the good work!

  • @shadmanmartinpiyal4057
    @shadmanmartinpiyal4057 3 ปีที่แล้ว

    Just amazing!!!

  • @nielsrozeboom8852
    @nielsrozeboom8852 3 ปีที่แล้ว

    Great stuff! :-)

  • @andremelinski5620
    @andremelinski5620 3 ปีที่แล้ว

    Really nice tutorial! I made some changes to get more realistic.. In post request, I removed the pathParameters and used the package uuid to generate a random ID when is a post request. With this I only use the body of the function instead of the body and the ID.

    • @CompleteCoding
      @CompleteCoding  3 ปีที่แล้ว

      Yes using UUIDs is a great idea.

    • @marwanehamdani2450
      @marwanehamdani2450 2 ปีที่แล้ว

      can you please share the code that you used I have the same issue

  • @devprakash5320
    @devprakash5320 2 ปีที่แล้ว

    smashed that like button

  • @elhadjndiaye769
    @elhadjndiaye769 4 ปีที่แล้ว

    Great tutorials thank you for that. How we can handle error when we write a ID which already exists in the table ?
    thank you again

    • @CompleteCoding
      @CompleteCoding  4 ปีที่แล้ว +1

      As far as I know there is no protection again writing a new file over an existing one. If you wanted to add this to the API, you would have to check if the file exists before trying to write. If you find a file then you can decide whether to return an error or overwrite anyway.

  • @johnbarker5686
    @johnbarker5686 3 ปีที่แล้ว

    Great tutorial and series! I encountered something, in the the response parameters Content-Type header comes back looking something like this: "multipart/form-data; boundary=----WebKitFormBoundary2CeWzE6z88mA2xSh". The POST body pairs (Name, Score) are base64 has string, bookended by that "----WebKitFormBoundary2CeWzE6z88mA2xSh" string. Tried using Busboy but that got messy.

    • @johnbarker5686
      @johnbarker5686 3 ปีที่แล้ว

      Turns out in PostMan I was adding the body key/values as form-value, not Raw JSON. Oops.

    • @CompleteCoding
      @CompleteCoding  3 ปีที่แล้ว

      Haha I've done that so many times too. Glad you got it working

  • @josejaimes4965
    @josejaimes4965 4 ปีที่แล้ว

    HI Sam,
    Thanks for sharing again.
    You have got the result in one shoot coding but How could I to manage any error? Could you say to me any idea because I have got and 502 Bad Gateway in Postman and I would like to fix it.
    I am seeing there are some console.log but where can I see them?
    Thanks.

    • @josejaimes4965
      @josejaimes4965 4 ปีที่แล้ว

      Jesus! This time was thought to find the error. It was only a bad sentence written. for me.
      I had written
      "const user = JASON.parse(event.body);" instead of
      "const user = JSON.parse(event.body);"
      BTW, your videos are incredibles.
      Thanks!

    • @CompleteCoding
      @CompleteCoding  4 ปีที่แล้ว

      That's a brilliant little typo. Typos can be such a pain and I still do them all the time too

  • @nesravnim
    @nesravnim 3 ปีที่แล้ว

    Hello kind sir, I really like the tutorial and all, can you please just tell me also the name of the VS Code theme that you are using in the video?
    Thank you in advance!

    • @CompleteCoding
      @CompleteCoding  3 ปีที่แล้ว

      I use Monokai Pro. It's a paid theme but you get a few colour themes for $10. Definitely a worth while investment.

  • @rakshahegde3856
    @rakshahegde3856 4 ปีที่แล้ว +3

    Could you please do one on UPDATEITEM. Struggling with it 😟

    • @CompleteCoding
      @CompleteCoding  4 ปีที่แล้ว

      That's a great idea. I'll add it to the list

    • @CompleteCoding
      @CompleteCoding  4 ปีที่แล้ว +1

      Here you go Raksha
      th-cam.com/video/wLSlhXsUTUo/w-d-xo.html

  • @marwanehamdani2450
    @marwanehamdani2450 2 ปีที่แล้ว

    After getting the internal servor error I went to the api gateway to test it and in the logs they show me this error Lambda execution failed with status 200 due to customer function error: Cannot set property 'ID' of null. Lambda request id: aae9419b-6019-4d72-98b5-ad77643937cb. I'm stuck on it .

    • @CompleteCoding
      @CompleteCoding  2 ปีที่แล้ว

      Somewhere in your code you'll be doing something like
      body.ID = 'something'
      The error is saying that body is not an object, but is null. Check where you get the 'body' from in your code

    • @marwanehamdani2450
      @marwanehamdani2450 2 ปีที่แล้ว

      @@CompleteCoding the line of let id = event.pathParameter.ID is the one that returns null I don't know how to deal with it I've tried the uuid but I don't know how to use it

    • @CompleteCoding
      @CompleteCoding  2 ปีที่แล้ว

      ​@@marwanehamdani2450I don't think that;s the line.
      That error would be "Cannot read property 'ID' of undefined"
      Your error specifically says "Cannot set property".
      What do you use that id for?

    • @marwanehamdani2450
      @marwanehamdani2450 2 ปีที่แล้ว

      I did the same code and when I commented the line of user.ID = ID I got a succes but of course it couldn't find the ID I have to check another method instead of pathparameters I gues

    • @marwanehamdani2450
      @marwanehamdani2450 2 ปีที่แล้ว

      @Complete Coding can you please show us with uuid method ...

  • @marceloosorio525
    @marceloosorio525 3 ปีที่แล้ว

    Well for newbies it isnt a good video... you didnt explain the tools, how you setup the environment... just paste a code ..... and "automagically" everything is working.... probably is a good video for people that already knows the 1st part... anyway thanks for share it...

    • @CompleteCoding
      @CompleteCoding  3 ปีที่แล้ว +2

      Thanks for the feedback Marcelo. This video is part of a longer series on Serverless where I go from setting up Serverless and AWS, create the repo and build everything that you see at the start of the video.
      I can see how jumping in at this video might not make loads of sense. I'll try and make it clearer in the future that this is part of a series.

  • @eddieandress6380
    @eddieandress6380 2 ปีที่แล้ว

    Hi Sam, I'm really enjoying this video series on Serverless - thanks so much for putting it together. I particularly appreciate the slow pace and bitesized nature of each video. Great work :)

    • @CompleteCoding
      @CompleteCoding  2 ปีที่แล้ว

      Thanks Eddie. I also enjoy learning from bitesized videos. I can easily rewatch bits I need to or skip videos I already know