Modelling a map in ember data

Hi,

I’m having some trouble figuring out how to model a map in ember data. I have an object already modelled that has a map as one of the fields.

Is there anything built in to ember to deal with this or am I going to have to model a key value tag and add an array of these to deal with this? Something like this:

App.KeyValue = DS.Object.extend({
  key: DS.attr('string'),
  value: DS.hasMany('App.Field')
});

App.Field being another model.

1 Like