Complete MongoDB Tutorial #22 - PATCH Requests

preview_player
Показать описание
🐱‍💻 View this course & other premium courses without ads on the Net Ninja Pro site:

🐱‍💻 Access the course files on GitHub:
(lesson code available from lesson 15 onwards)

🐱‍💻 Modern JavaScript Course:

Рекомендации по теме
Комментарии
Автор

just watched and coded along on my own project from lesson #1 to #22, and I now have a very good understanding (wasnt the way before) of how CRUD works, and of course, how mongoDB works.
I cant thank you enough

calarcher
Автор

I have learnt Node, MongoDB, express and React and I am pretty capable of them... BUT IDK HOW TO CONNECT THE FRONTEND TO THE BACKEND. I have always used ejs with node and used react alone when practicing! Please do a MERN project next. I know there are a lot of places I can learn from but you are the best coding teacher out there... I can confidently say that what I learnt on this channel is something I would never been able to do on other channels

maxovicsteiner
Автор

I was struggling for 3 hours trying solve a problem and your video just activated a part of my brain lol thanks

lonar
Автор

Patch requests to documents in a MongoDB, so beautifully explained. Thank you, Shaun.

{2023-09-01}

Pareshbpatel
Автор

If anyone sees the updates are inside a new object property inside the document is because you're making the same mistake I did:
let db = getDb();
  if (!ObjectId.isValid(bookId)) {
    res.status(404).json({ msg: 'Document Id is not valid.' });
  }
  try {
    const result = await db
      .collection('books')
      .updateOne({ _id: ObjectId(bookId) }, { $set: {updates} }); <<--- here, the extra curly braces insert a new property
    res.status(200).json(result);
  } catch (error) {
    res.status(500).json({ error: 'Could not update the document.' });
  }

alexpiano
Автор

This is such a great tutorial! Almost done!

brendonvz
Автор

The way of kings is the lowest rated book in the SLA, but it's definitely not an 8! Jokes aside, good tutorial. Was unsure if patch worked in document dbs like it does in SQL, so really appreciate the video!

Batlas
Автор

Will you be making any series on Node Express Soon?
If yes then do let me know

ritviksardana
Автор

I appreciate this, You very useful teacher !

loversofcat
Автор

objectId method returning error now like:
TypeError: Class constructor ObjectId cannot be invoked without 'new'
at S:\web\express\app.js:32:29
at Layer.handle [as handle_request]
at next
at Route.dispatch
at Layer.handle [as handle_request]
at
at param
at param
at Function.process_params
at next

GOPINATHBCSE
Автор

although my connection successful with the database, no data is being rendered . everytime i am trying to connect to "localhost:3000/books" i dont get any data i only get [] this on my screen. even with postman after every task acknowledgement is true but deleted count or updatedcount is 0

_dishaagarwal
Автор

Hi sir, suppose there is another object inside the object, then how do we update that object?

vishnups
Автор

My PATCH is giving back error. Cannot PATCH can anyone help

GeraldOfori-przt
Автор

sir the app.get from a particular id is not working for a new version, the error says "Class constructor cannot be invoked without new"

RagulVasanthS.M
Автор

why do you use patch here and not just put?

bramvanoverveld