How does index entries look for multikey attribute?

How does index entries look for multikey attribute?

Hello Monika and thank you for your question.

Where an indexed field is an array, the index will be a multi key index. and index entry is created on each value found in the array. So multi key indexes can be very large. Multikey indexes can support primitives, documents, or sub-arrays.

Note: You cannot create a compound multikey index if more than one to-be-indexed field of a document is an array.

You will find more information in the following link:

Best regards,


Thank you Sheliya.
I had same concept. But, my query is when a multi key index have index entry for each value found in the Array, then Why index size of multi key index on object ID in an array is less than index on simple root level attribute ?

For example : I have 10^7 documents in a collection ‘DN’ which has a field ‘rid’, which has almost unique values.
I copy this collection data in other format , which I name as ‘LE’ collection. Here, 100 rids are embedded as an object field in an array (rDocs) in one document. So, there are 10^5 documents.

Index Size of simple index on rid in ‘DN’ collection is greater than Index size of rDocs.rid in ‘LE’ collection.

I have implemented multiple times such examples, but every time it shows this similar result