Node JS in Hindi #37 PUT API | Update data in MongoDB

Поделиться
HTML-код
  • Опубликовано: 19 дек 2024

Комментарии • 25

  • @malikwahid3400
    @malikwahid3400 3 года назад

    Great method of teaching

  • @MuhammadUsman-ok5vs
    @MuhammadUsman-ok5vs Год назад +1

    very well explained

  • @surakshitkapoormathsc1910
    @surakshitkapoormathsc1910 2 года назад

    Completely doubt solving video

  • @codewithmhj
    @codewithmhj 10 месяцев назад

    SIR YOUR EFFORTS ARE PRICE LESS, BTW SIR ONE QUESTION WHAT DO YOU THINK IS MORE EASY FRONT END OR BACKEND? LOVE FROM PAKISTAN ❤❤❤❤

  • @comic_forever
    @comic_forever 3 года назад

    bhaiya abhi tak jitna aapne bata dia hai agar use krke we can build somethng chahe chota hi to please give link. koi chota sa project

  • @usmanAli-hw5xu
    @usmanAli-hw5xu Год назад

    thank you sir

  • @anilrajmeena4373
    @anilrajmeena4373 3 года назад

    Api Method or Api Endpoints me kya difference hai?

  • @sameerahmad-wd2zw
    @sameerahmad-wd2zw 3 года назад

    Complex api's with multiple collection kab tak aayegi sir ?

  • @gurjarankitchhalotre9901
    @gurjarankitchhalotre9901 3 года назад

    great

  • @VivekSharma-kx2ny
    @VivekSharma-kx2ny 2 года назад +3

    The data is not updated in this method, u just ran the code , and the status is sent in res.send() by default

  • @cyphermediaschool
    @cyphermediaschool 2 года назад +2

    app.put('/update/:id', async (req, res) => {
    let db = await dbConnection();
    db = await db.updateOne(
    { _id: ObjectId(req.params) },
    {
    $set: req.body,
    }
    );
    res.send(db);
    });

    • @rahul-sonawane
      @rahul-sonawane Год назад

      😊

    • @07Hindi_Kahaniya
      @07Hindi_Kahaniya Год назад

      hii
      can you help me in api creation

    • @shtanmoy
      @shtanmoy Год назад

      app.put("/update/:id",async(req,res)=>{
      const fullDB = await dbConnection();
      const data = await fullDB.updateOne({_id:new ObjectId(req.params.id)},{$set:req.body});
      res.send(data);
      })

  • @BhagyashriTamrakar
    @BhagyashriTamrakar 7 месяцев назад

    lecture 37 completed

  • @07Hindi_Kahaniya
    @07Hindi_Kahaniya Год назад

    can any one help me i am stucked for 5 days in the api sections

    • @07Hindi_Kahaniya
      @07Hindi_Kahaniya Год назад

      if anyone is good with api in node js please contact me

  • @khizrshaikh9902
    @khizrshaikh9902 3 года назад

    First Comment I want heart

  • @anonymous_hello
    @anonymous_hello 2 года назад

    My code for PUT method is not working . Can somebody explain
    app.put('/update/:id', async (req,res) =>{
    // console.log(req.params.id)
    const data = await dbConnect();
    const result = await data.updateOne(
    {_id: req.params.id},
    {$set: req.body}
    )
    res.send(result);
    })
    o/p at postman
    {
    "acknowledged": true,
    "modifiedCount": 0,
    "upsertedId": null,
    "upsertedCount": 0,
    "matchedCount": 0
    }

    • @shtanmoy
      @shtanmoy Год назад

      app.put("/update/:id",async(req,res)=>{
      const fullDB = await dbConnection();
      const data = await fullDB.updateOne({_id:new ObjectId(req.params.id)},{$set:req.body});
      res.send(data);
      })

    • @devanshurawat826
      @devanshurawat826 Год назад

      getting same problem on console, while postman still "sending request..."

    • @animeheaven7222
      @animeheaven7222 Год назад

      @@devanshurawat826 app.put('/:_id', async (req, resp) => {
      let data = await dbConnect();
      data = await data.updateOne(
      { _id: new ObjectId(req.params._id) },
      { $set: req.body }
      );
      resp.send(data);
      });
      and import the objectId like this
      const { ObjectId } = require('mongodb');

  • @dProfessor_
    @dProfessor_ Год назад

    great