我采用的解决方案是,在我的模板处理程序中,我没有使用 Posts.find() 返回游标,而是创建了一个 JSON 对象,该对象具有可以由把手模板处理的结构(一个类别对象数组,其中每个类别有一系列帖子):
Template.postLists.categorizedPosts = function() {
    var allPosts = Posts.find({}, {sort:{category:1}}).fetch();
    // Then I iterate over allPosts with a loop, 
    // creating a new array of this structure:
    // for ...
    var catPosts = [ { category:"cat1", posts: [ {post1}, {post2} ] },
                     { category:"cat2", posts: [ {post3}, {post4}, {post5} ] },
                     // etc... 
                   ];
    // end loop
    return catPosts;
模板是这样的(但使用表格而不是 UL,只是在这里使用 UL 进行更清晰的演示):
{{#each categorizedPosts}}
  {{category}}  
  <ul> 
    {{#each posts}}
    <li>{{posts.title}}</li>
    {{/each}}
  </ul>
{{/each}}
请注意,当您返回这样的对象(而不是 Posts.find() 返回的光标对象)时,Meteor 的模板引擎将失去智能检测集合中只有一个对象何时发生更改的能力,并改为修补 DOM完全重新渲染模板。所以在这种情况下,即使在数据库中更新了单个 Posts 对象,模板也会完全重新呈现。这就是缺点。但好处是它有效;)