emberdata and mongodb embedded objects ID undefined
===

I have a problem regarding Ember data and Mongodb embedded objects. Here's my model :
    
    App.Contact = App.Entity.extend({
    	name             : DS.attr('string'),
    	firstname        : DS.attr('string'),
    	additional_names : DS.attr('string'),
    	civility         : DS.attr('string'),
    	birthday         : DS.attr('date'),
    	organization     : DS.belongsTo('App.Organization'),
    	role             : DS.attr('string'),
    	photo_source     : DS.attr('string'),
    	photo_uri        : DS.attr('string'),
    	gravatar_mail    : DS.attr('string'),
    	addresses        : DS.hasMany('App.Address', { embedded: true }),
    	emails           : DS.hasMany('App.Email', { embedded: true }),
    	phones           : DS.hasMany('App.Phone', { embedded: true })
    });



Now I'm trying to get a contact: (GET /app/api/v1/contact/4f86c4774ab63c2417000001/) here's what I get :

    {
        "additional_names": null,
        "addresses": [],
        "birthday": null,
        "civility": null,
        "emails": [
            {
                "email": "alexandre@test.com",
                "label": null,
                "resource_uri": "/app/api/v1/contact/4f86c4774ab63c2417000001/emails/0/",
                "type": "HOME"
            }
        ],
        "firstname": "Alexandre",
        "gravatar_mail": null,
        "groups": [],
        "id": "4f86c4774ab63c2417000001",
        "name": "Simoui",
        "organization": null,
        "phones": [],
        "photo_source": null,
        "photo_uri": "/static/img/nophoto.png",
        "resource_uri": "/app/api/v1/contact/4f86c4774ab63c2417000001/",
        "role": null
    }


As you can see everything is good, my "root" object has an id but the embedded object "emails" hasn't. Because in mongodb id is not set on subdocuments but only on root document.

This way ember-data see that "email" object hasn't id and then it try to get it through the API. For example : GET /app/api/v1/email/set// 404 (NOT FOUND)

To be sure the problem was that I tried to return Mongodb subdocuments with a fake ID field. Like : (see difference on email document)


    {
        "additional_names": null,
        "addresses": [],
        "birthday": null,
        "civility": null,
        "emails": [
            {
                "id": 431,
                "email": "alexandre@test.com",
                "label": null,
                "resource_uri": "/app/api/v1/contact/4f86c4774ab63c2417000001/emails/0/",
                "type": "HOME"
            }
        ],
        "firstname": "Alexandre",
        "gravatar_mail": null,
        "groups": [],
        "id": "4f86c4774ab63c2417000001",
        "name": "Simoui",
        "organization": null,
        "phones": [],
        "photo_source": null,
        "photo_uri": "/static/img/nophoto.png",
        "resource_uri": "/app/api/v1/contact/4f86c4774ab63c2417000001/",
        "role": null
    }

Then I got no problem everything is fine. So my question is: Is there a way to fix it?