Node.js 未从分页集合加载任何文档

Node.js 未从分页集合加载任何文档,node.js,pagination,meteor,Node.js,Pagination,Meteor,我正在尝试使用对集合进行分页,但按照建议的基本用法实现时,不会显示任何文档 我的meteor应用程序具有以下目录结构: 服务器文件夹:--server.js 客户端文件夹: --client.js --client.html <body> <div> Passatempos:</div> {{> PassatemposBD}} </body> <template name="PassatemposBD"> {{

我正在尝试使用对集合进行分页,但按照建议的基本用法实现时,不会显示任何文档

我的meteor应用程序具有以下目录结构:

  • 服务器文件夹:--server.js

  • 客户端文件夹: --client.js --client.html

  • <body>
       <div> Passatempos:</div>
       {{> PassatemposBD}}
    </body>
    <template name="PassatemposBD">
       {{> pages}}
       {{> pagesNav}}  <!--Bottom navigation-->
    </template>
    
  • common.js
在common.js中:

PassatemposBD=新流星系列(“passatempos”);
Pages=新的Meteor.Pagination(“PassatemposBD”)

然后,在server.js中,我用从web获取的文档填充这个集合(填充大约需要30秒)。然后我发布它:

Meteor.publish('passatempos', function() {
    return PassatemposBD.find({});
});
在client.js中:

Meteor.subscribe('passatempos');
在client.html中

<body>
   <div> Passatempos:</div>
   {{> PassatemposBD}}
</body>
<template name="PassatemposBD">
   {{> pages}}
   {{> pagesNav}}  <!--Bottom navigation-->
</template>

节奏:
{{>PassatemposBD}
{{>页面}
{{>pagesNav}
当我运行应用程序时,它会显示一段短暂的旋转时间(1秒或更短),然后根本不显示任何内容,也不显示下面的导航。在浏览器控制台中没有错误,服务器端也没有错误


为什么不显示集合页面和分页项目?

meteor pages文档中的
集合名称
是传递到
new meteor.collection
中的字符串,而不是保存集合的变量的名称。因此,您的模板应该称为
passatempos
,而不是
PassatemposBD

我已经尝试将模板更改为passatempos,但它仍然没有显示集合中的任何项目。我担心,由于Meteor.Pagination的创建与集合(在common.js中)的创建同时进行,并且集合在服务器中填充大约需要30秒,因此它会将空集合提供给模板。关于如何解决这个问题有什么建议吗?