title: How to create an index for a complex MongoDB query
body: <p>I need to create an index for the following query:</p>
  <pre><code>await Activity.find({
     $and: [
        {
           lastUpdated: {
              $gte: new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000),
           },
        },
        {
           &quot;followers._user&quot;: _user,
        },
        {
           global: true,
        }
     ]
  })
  .collation({
     locale: &quot;en_US&quot;,
     numericOrdering: true,
  })
  .sort({
     lastUpdated: -1
  })
  .skip(
     length
  )
  .limit(
     10
  )
  </code></pre>
  <p>I have the below index in place currently but the query does not use it.</p>
  <pre><code>ActivitiesSchema.index(
    { &quot;followers._user&quot;: 1, global: 1, lastUpdated: -1 },
    {
      collation: {
        locale: &quot;en_US&quot;,
        numericOrdering: true,
      },
    }
  );
  </code></pre>
  <p>What can I try to solve this?</p>