HasMany's ManyArray


What is the difference between these two usages of ManyArray? Is one more correct than the other? Does it matter?

export default DS.Model.extend({
  comments: DS.hasMany('comment')

export default DS.Model.extend({
  post: DS.belongsTo('post')

// Usage 1: Access a post's comments directly
post.get('comments').forEach((comment) => {
    // Do something with comment here

// Usage 2: Access a post's comments after promise resolves
post.get('comments').then((comments) => {
    comments.forEach((comment) => {
        // Do something with comment here


Yes it does matter. Here’s a link to check out: https://guides.emberjs.com/v2.6.0/models/relationships/#toc_many-to-many In the first usage your program cannot continue until this process finish. The second usage causes the program to work in the background, gathering all the data first, letting other processes continue. When the second has received all data it resumes.(keeping it’s promise to return a value.)


So both methods yield the exact same result, and the only difference is that the first usage is synchronous while the second is asynchronous?