All language subtitles for 011 Deleting Documents_Downloadly.ir_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian Download
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

And now as the final one

of the four CRUD operations,

we have deleting documents.

And so by now this should already be pretty familiar.

And that's why I want to leave this one to you

as a challenge, all right?

So again, this one is gonna be pretty similar

to update tour only with a small number

of differences, but I think you can figure out

how it works, for example, using the documentation

and of course the other handle functions as an example.

Okay, so keep in mind that here for example

we used find by ID and update

and so you probably can already guess

how this method is gonna be called in delete tour.

All right.

And again, if you're not sure,

you can take a look at the documentation

and what kind of data it expects

and then based on all that, try to implement it.

Okay.

So please pause the video here and take a minute

to really try to do it on your own.

Okay, hope you got that one to work

and anyway, here goes my quick solution.

So again, defining this one as an async function

then try catch.

Here is the error and then let's move this one up.

Get this error response from over here.

And now we are gonna use

tour.findByIdAndDelete

and now all this method here actually needs

is the tour ID.

So req.params.id and I hope you figured

this one out from the documentation.

Then of course we need to await in order

for the deletion actually to happen

and that's actually alt.

So in this case, we actually don't save anything

to any variable because remember,

we actually don't send anything back

to the client, okay.

So in a RESTful API, it is a common practice not

to send back any data to the client

when there was a delete operation, okay.

And also the 204 is kind of a standard as well.

So give us a save now and it should actually already work

like this.

And so to start, let's just create some stupid tour here.

So let's create a Jonas tour here.

Give it a save and so,

when we get all tours, indeed it's gonna be here

and so let's go ahead, copy the ID,

then open or delete tour route here

and then all we need is to really send this delete request

to this route, hit send.

And so again, we get back the 204 status code

and Postman in that case actually doesn't display anything.

All right.

And just to make sure, let's confirm it very quick.

And yeah, it's gone from here.

And so our tour was effectively deleted.

Okay, now if you didn't manage

to complete the challenge on your own,

then of course that's no problem at all.

I just wanted you to think about it

and most of all take a look at the documentation

on your own because it really makes

all the difference for you to start practice

this kind of stuff as soon as possible.

Anyway, with this we implemented

the basic CRUD operations.

The next video we will then finally really start

to model or tour a bit better.

So right now we only have names,

prices, and ratings, and that's not really enough

to describe a tour and so yeah,

in the next video we will kind of create

a better, a bigger, more complete model.

So I hope to see you there soon.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.