MongoDB in NodeJS - Find one and Update (2020) [Episode #7]

preview_player
Показать описание
In this video we cover a powerful Mongo function called findOneAndUpdate. This allows us to either insert or update (known as "upsert") a document.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

🖥️ Source code:

🙋‍♂️ Need help? Ask in our Discord community:

💡 Have an idea for a video or course? Request it here:

------------------------------

🕒 Timestamps:
00:00 Introduction
00:48 Using findOneAndUpdate
06:19 Fixing a deprecation warning
07:07 Outro

#mongodb #javascript #nodejs #wornoffkeys

FTC Legal Disclaimer - Some links found in my video descriptions might be affiliate links, meaning I will make commission on sales you make through my link. This is at no extra cost to you and it helps support the channel so I can make more free YouTube videos.
Рекомендации по теме
Комментарии
Автор

🔥 Get the code:

🙋‍♂ Need help? Ask in our Discord community:
wornoffkeys.com/discord

WornOffKeys
Автор

holy shit, i was going crazy and i didn't understand why my data wasn't updating. that "new: true" option really helped me out! thanks a bunch!
you got my sub man. u really helped me out. i really didn't notice in the docs that it was a thing.

ItsNoahHi
Автор

Thank you so much for the video! I appreciate it a lot! I was stuck on this part for a long time!

mtejera
Автор

Alex, thank you much!!! You helped me complete my app. Thank you for this man !!! 👏👌🙌🏾😂😭

codedynamics
Автор

It doesnt update in the mongo website, why? No errors btw

SrGabito
Автор

How do i sum a value of an Object on mongo? For an example, i have the sum of the current balance value with another random generated value.

jkp
Автор

How activate the mongodb auto completation?

koroagamer
Автор

So, with *upsert*, we can find a new user and update the record ..
Actually everything in the record except for the password ??

And with the help of 'new', we can update the password ?

sayantaniguha