Array Value for fields

Hi
What exactly are Supplementary values? In the lesson it is mentioned as a summary of all the values… How is a supplementary value defined from all the values?
Thanks

Hi Mouna_29112,

The lecture: MongoDB Documents: Fields with Arrays as Values: explains that we can put values as an array fields.

Supplementary in the example means the fields which are not avilable for all the documents in a collection. Suppose, one weather report measure wind using “AG1” field and other using “BG1” field. So these would be called as supplementary values. And then we can put these values in an array as per their respective document.

So that if we want to improve the query performance using Indexes, then we can easily build an index on that particular array.

Kanika

1 Like

Thanks Kanika for your response. That was helpful.