I have this data structure:

```
{
"_id" : ObjectId("582ecaa97be792282ca31bc4"),
"hero" : {
    "5001" : {
        "id" : 5001
        "name" : "Rogue"
             }
    "5002" : {
        "id" : 5002
        "name" : "Mage"
             }
    "5003" : {
        "id" : 5002
        "name" : "Paladin"
             }
         }
}

```

I have the query.

```
db.getCollection('hero').find({"Hero":{"5001":{"id" : 5001}}})

```

It returns 0 results.
I could store the Heros separately, but I would like to know how to do this query first. What I would like to get out of this is all data under 5001 if I query with 5001 and so forth.

Thanks!

Edit: I found the answer by using dot notation, I already tried dot notation but i got it a bit wrong when trying it, I thought it was only for arrays. Here is what you would do if anyone else is looking.

```
db.Runes.find({ "hero.5001.id": 5001 },{"hero.5001":1})

```