Use Collection#create
instead:
createcollection.create(attributes, [options])
Convenience to create a new instance of a model within a collection. Equivalent to instantiating a model with a hash of attributes, saving the model to the server, and adding the model to the set after being successfully created. [...] Pass
{wait: true}
if you'd like to wait for the server before adding the new model to the collection.
So if you do this:
@collection.create(
{ content: content }
{ wait: true }
)
Then the model won't be added to the collection until the server has responded and the model will have its server-supplied id
by then.