本文介绍了单个 Meteor 实例可以侦听多个 MongoDB 数据库并做出反应吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想构建一个分布式 Meteor 应用程序网络,每个应用程序彼此共享其 Mongo 数据库的某些部分.这可能吗?

I would like to build a network of distributed Meteor apps that each share some parts of their Mongo database with each other. Is this possible?

推荐答案

是的,您可以通过使用以下方法更改在服务器端定义集合的方式:

Yes you can do this by changing how you define the collection on the server side using:

var database = new MongoInternals.RemoteCollectionDriver("<other mongo url>");

MyCollection = new Mongo.Collection("collection_name", { _driver: database });

这篇关于单个 Meteor 实例可以侦听多个 MongoDB 数据库并做出反应吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 21:45