首页 > 解决方案 > 如何在 Meteor.js 启动时禁用订阅通知?

问题描述

开始通知:

** You've set up some data subscriptions with Meteor.publish()

如何禁用?

标签: meteor

解决方案


我假设您收到了整个错误消息:

** You've set up some data subscriptions with Meteor.publish(), but
** you still have autopublish turned on. Because autopublish is still
** on, your Meteor.publish() calls won't have much effect. All data
** will still be sent to all clients.
**
** Turn off autopublish by removing the autopublish package:
**
**   $ meteor remove autopublish
**
** .. and make sure you have Meteor.publish() and Meteor.subscribe() calls
** for each collection that you want clients to see.

要使通知消失,只需执行它要求您执行的操作并运行:

meteor remove autopublish

是什么autopublish

Autopublish 是一个用于快速原型设计的包。它将所有集合从 MongoDB 发送到客户端以便于使用。从文档:

将所有服务器集合发布到客户端。这个包对于构建应用程序原型很有用,而无需担心哪些客户端可以访问某些数据,但应在应用程序需要限制客户端查看哪些数据时立即删除。

在将您的应用程序放到互联网上之前,您需要关闭它并使用出版物和订阅来保护、过滤和管理您的数据流


推荐阅读