I'm trying to build a map as part of a group operation in MongoDB but am having no luck.

My documents are structured as follows : 

```
type : artist,
artist : David Bowie,
song : "Starman"

```

For example as part of my aggregation I want to group all "types" and have a map containing the artists name as the key and the songs as a value. For an output like : 

```
[_id : artist, myMap : ["David Bowie" : "Starman"]]

```

But I'm not sure if this is even possible. I've tried using Mongos $push operation but it doesn't like it when I try to push a map. Has anyone attempted this before?

Heres the query I tried : 

```
 db.music.aggregate(
                 {
                   $group: {
                             _id: "$type",
                             myMap : { $push: {"$artist" : "$song" }}
                           }
                 }
              )

```