how to create index mongodb properly?
<p>let say i have this huge documents.</p>

<p>2 of them got this array of object;</p>

<pre><code>{
  status: "A",
  group: "public",
  "created.dt": ....
}

{
  status: "A",
  group: "private",
  "created.dt": ....
}
</code></pre>

<p>i indexed and ensure like this : </p>

<pre><code>db.collection.ensureIndex({"created.dt":-1});

db.collection.ensureIndex({"created.dt":-1, "status":1});
db.collection.ensureIndex({"created.dt":-1, "group":1});

db.collection.ensureIndex({"created.dt":-1, "status":1, "group":1});
</code></pre>

<p>Query: </p>

<pre><code>db.collection.find(
{
  "status": { 
    $in: ["A", "I"] 
  },
  "asset_group": "public"
},
{
  sort: {
   'created.dt':1
  }
}
).count();
</code></pre>

<p>is it wrong ?</p>

<p>after i make this index still slow.
please help me proper index.thank you</p>