title: MongoDb - add index on 'calculated' fields
body: <p>I have a query that includes an <code>$expr</code>-operator with a <code>$cond</code> in it.
  Basically, I want to have objects with a timestamp from a certain year. If the timestamp is not set, I'll use the creation date instead. </p>
  
  <pre><code>{
    $expr: {
      $eq: [
        {
          $cond: {
            'if': {
              TimeStamp: {
                $type: 'null'
              }
            },
            then: {
              $year: '$Created'
            },
            'else': {
              $year: '$TimeStamp'
            }
          }
        },
        &lt;wanted-year&gt;
      ]
    }
  }
  </code></pre>
  
  <p>It would be nice to have this query using a index. But is it possible to do so? Should I just add index to both <code>TimeStamp</code> and <code>Created</code>-fields? Or is it possible to create an index for a <code>Year</code>-field that doesn't really exist on the document itself...?</p>