O'Reilly logo
  • Geeta Gharpure thinks this is interesting:

Think of category IDs, for instance.

{ name: "Wheelbarrow",
  tags: ["tools", "gardening", "soil"]

If you create an index on tags, then each value in this document’s tags array will appear in the index. This means that a query on any one of these array values can use the index to locate the document. This is the idea behind a multikey index: multiple index entries, or keys, end up referencing the same documen


Cover of MongoDB in Action


multi key index = tags