如何在Meteor应用之间共享MongoDB集合? [英] How can I share MongoDB collections between Meteor apps?

查看:76
本文介绍了如何在Meteor应用之间共享MongoDB集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够为我的项目提供一个管理应用程序和一个客户端应用程序.理想情况下,我希望能够拥有一个共享的MongoDB集合.我将如何做到这一点?

I'd like to be able to have an admin app and a client app for my project. Ideally, I'd like to be able to have a shared MongoDB collection. How would I be able to accomplish this?

我尝试在两个不同的应用程序中创建具有相同名称的集合,但发现Meteor会将数据分开.知道我能做什么吗?谢谢.

I tried creating collections with the same name in two different apps, but found that Meteor will keep the data separate. Any idea what I can do? Thanks.

推荐答案

export MONGO_URL=mongodb://localhost:3002/meteor

然后运行流星应用程序,它将更改流星使用的默认数据库.因此,共享数据库或馆藏将不是问题! 出于管理原因,我将使用由我自己管理的单个MongoDB服务器,而不是使用流星内部的MongoDB.

Then run meteor app, it will change the default database meteor uses. So share databases or collections won't be a problem! For administrative reason, I would use a individual MongoDB server managed by myself other than using meteor's internal MongoDB.

这篇关于如何在Meteor应用之间共享MongoDB集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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