Array data type in MongoDB

Guys, I cannot understand the meaning of array data type. Any Help?

Think about an array in any programming language and try to apply that knowledge here.
Let us know what exactly you’re struggling with?

I videos.movies there is an field named cast it has a type of array. This is what I am trying to understand

Click the Documents tab and in that window click the Cast field to expand it. Maybe it will make more sense.

A movie has one or more casts.

Yes you are right. Thanks for your help

Hi @007_jb, thanks for your contribution :slight_smile:

Hi @Shrey_46820,

This means the cast field in the video.movies collection has more than one value and they are stored in an array.

For instance this is what it could look like :

{
"Cast":["Claudia Cardinale","Henry Fonda","Jason Robards","Charles Bronson"]
...
}

Hope it helps!

If you have any other issue, please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer