All language subtitles for 006 CRUD_ Creating 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
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

This video will be the first

of the four CRUD operation videos.

So this first one is about creating new documents.

But before we start creating new documents,

let me actually address a concern that you might be having.

So maybe you're wondering,

why are we actually doing all this stuff in a terminal?

And how does this relate to our Express application

that we built in the last section?

Well, the answer for that is that right now,

I want you to learn the absolute fundamentals of MongoDB,

without the context of any application.

So really, completely outside of Node.js.

Because in theory, we could us MongoDB

with any other language or any other framework.

It doesn't have to be with Node.js,

and so I think it's actually a good idea

to learn MongoDB standing completely on its own,

without the context of any other language.

Okay?

Later on, we will of course connect

a MongoDB database with our application,

so that in the next section,

we can then actually start working with databases

inside of our Express application.

And by then we will use

a MongoDB driver just for Node Express,

so that we can use our JavaScript language

to interact with our MongoDB database.

All right?

But for now, let's just learn MongoDB without any of that.

All right?

So in the last lecture, we created a new database.

A new collection inside, called tours,

and then one new document in there.

Right?

Remember that?

And to do that, we used insert 1.

Remember that?

But now, let's actually create

two documents at the same time.

So that works like this.

db, with just again, the current database, then .tours,

which is the collection where we want

to add our new documents, and then .insertMany.

Okay?

And insertMany is gonna accept an array of multiple objects.

So an array, and then close it.

So an empty object, and that may actually

put the second empty object here also already,

and so all we need to do is to fill up these objects.

So name, this one is called The Sea Explorer.

It has a price of 497, and a rating of 4.8.

And then the next object.

Let's give it a name of The Snow Adventurer.

Which is one of the other nine tours that we have.

Then the price is a bit more expensive, 997.

And the rating is 4.9.

And actually, let's add another field here.

So, remember from the intro lecture

how I said that MongoDB documents are very flexible.

And so they do not all have to have the same structure.

Okay?

So we can have different fields in different documents.

And so let's add the difficulty here.

And set this one to easy.

Okay?

So that's it, let's hit return here.

And so we inserted two new documents,

and here we see the IDs that they got.

So these two auto-generated

unique identifiers for each of them.

Okay?

Now just to make sure, remember make db.tours.find,

and here indeed, we now have our three tours.

So that's the one we created in the last lecture,

and then the two that we just created.

Okay?

So that's actually it for this lecture,

just to recap, we used the insertMany function

to pass in an array of two objects,

or two documents that we wanted to create.

Okay?

So that's all I had for this one.

In the next one, we will then learn how to do

some advanced queries to search for data in our database.

So that's an exciting one, so let's move on immediately.

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