// Snippet from Template
<div class="post-container">
{{#each elements}}
{{> post-element this}}
{{/each}}
</div>
// Snippet from Client
Meteor.subscribe('thePosts');
// Snippet from Server
Meteor.publish('thePosts', function(){
return Posts.find({}, {sort:{createdAt:-1}, reactive:true});
});
When I do...
Posts.insert({body:postBody, createdAt: new Date()});
The post document gets added and appears at the end of my list, as opposed to descending order as specified in my publish function. Any idea about what I am doing wrong?
Thanks!