【发布时间】:2016-07-17 16:51:08
【问题描述】:
我正在尝试构建一个管理面板,该面板将连接到另一个应用程序数据库并能够更改存储在那里的数据。
var remote = DDP.connect('http://localhost:3000/');
var ServerAItems = new Mongo.Collection('items', { connection: remote });
Meteor.startup(function() {
console.log(remote);
remote.subscribe('smallBatchProducts', function(item){
});
console.log(ServerAItems.find().count(), 'test');
});
ServerAItems.find().count(); //returns 0
我查看了 Meteor: No docs from remote collection in template helper when connecting two apps via DDP 和 Connect two Meteor applications using DDP ,但仍然无法弄清楚如何与数据交互并让客户端访问它。 localhost:3000 上的发布是 smallBatchProducts。
我打算让 Flow Router 处理路由。谢谢
【问题讨论】: