Q19: What is a Multikey Index?

When an index is created on a field that contains an array value, MongoDB automatically creates a Multikey Index. It indexes each individual element inside the array separately. Limitations: A compound index can index at most ONE array field.

Key Takeaways
  • Automatically created when indexing array fields.
  • Cannot construct compound multikey indexes spanning multiple array fields.
Knowledge Check

Can a compound index include two separate array fields in MongoDB?