如何正确使用 Meteor.connect() 连接另一个 Meteor 服务器 [英] How to properly use Meteor.connect() to connect with another Meteor server

查看:58
本文介绍了如何正确使用 Meteor.connect() 连接另一个 Meteor 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在/client/main.coffee 中的新客户端代码

My new client code in /client/main.coffee

Xingyun = Meteor.connect "localhost:3000"
System = new Meteor.Collection "system", Xingyun
Meteor.subscribe "system"

在我的原始流星代码中,系统"已发布,系统"集合包含一个文档.我可以用System.find().count()"来验证.

In my original meteor code, the "system" is published and the "system" collection contains one doc. I can verified it with "System.find().count()".

在我的新客户端浏览器上,System.find().count()"总是返回 0.

On my new client browser, "System.find().count()" always return 0.

推荐答案

请试试Xingyun.subscribe "system"

这篇关于如何正确使用 Meteor.connect() 连接另一个 Meteor 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆