title: Why does direction of index matter in MongoDB?
body: <p>To quote the <a href="http://www.mongodb.org/display/DOCS/Indexes" rel="noreferrer">docs</a>:</p>
  
  <blockquote>
    <p>When creating an index, the number associated with a key specifies the
    direction of the index, so it should always be 1 (ascending) or -1
    (descending). Direction doesn't matter for single key indexes or for
    random access retrieval but is important if you are doing sorts or
    range queries on compound indexes.</p>
  </blockquote>
  
  <p>However, I see no reason why direction of the index should matter on compound indexes. Can someone please provide a further explanation (or an example)?</p>