// 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});
});
当我做...
Posts.insert({body:postBody, createdAt: new Date()});
发布文档被添加并出现在我的列表末尾,而不是我的发布函数中指定的降序。知道我做错了什么吗?
谢谢!