MongoDB find key on nested object KEY (JSON)
<p>So pretty new and absolutely uneducated on MongoDB.  </p>

<p>Having this JSON structure:</p>

<pre><code>{
"id": "123456",
"makes": {
    "abc": {
        "att1": 4,
        "att2": "fffff",
        "att3": 46
        },
    "fgh": {
        "att1": 8,
        "att2": "ggggg",
        "att3": 6
    },
    "rty": {
        "att1": 3,
        "att2": "hhhh",
        "att3": 4
        },
    "iop": {
        "att1": 4,
        "att2": "llll",
        "att3": 3
        }
}
</code></pre>

<p>}</p>

<p>how can I query the DB for "fgh" make?
I tried:</p>

<pre><code>db.&lt;myCollection&gt;.find({"makes":"fgh"})
</code></pre>

<p>but that doesn't work.
It works fine if I write:</p>

<pre><code>db.&lt;myCollection&gt;.find({"makes.fgh.att1":8})
</code></pre>

<p>thank you in advance!</p>