I want to retrieve a document from mongodb and then convert it a flat object or flat array.So lets say i am having this document:

```
{
    "_id":"57db3e2269d84bfc06ccecef",
    "profileId": {
        "_id":"57d838072902f1280324cc8d",
        "fname":"name",
        "lname":"name2"
    },
    "subjectId": {
        "_id":"57a0d71fb62eaf002e1258c2",
        "title":"Some Title
    },
    "comments": [{
        "_id":"57db3f046a8dde181a4cce65",
        "text":"fggg"
    }],
    "type":"post",
    "text":"dddddddddddddddddddddd",
    "datetime":"2016-09-16T00:34:42.888Z"
}

```

And I want to convert it like this(lets say i don`t need the ids of profileId and subjectId anymore):

```
{
    "_id":"57db3e2269d84bfc06ccecef",
    "fname":"name",
    "lname":"name2",
    "title":"Some Title,
    "comments":[
        "text":"fggg"
    ],
    "type":"post",
    "text":"dddddddddddddddddddddd",
    "datetime":"2016-09-16T00:34:42.888Z"
}

```