如何让meteor.com应用程序使用外部mongo db [英] How to get meteor.com apps to use external mongo db
问题描述
在我的开发机上,我可以设置环境变量MONGO_URL来定义我希望我的应用程序使用的mongo实例.如何设置我在meteor.com上的应用将使用的mongo实例?
On my dev machine I can set the environment variable MONGO_URL to define the mongo instance I want my app to use. How to I set the mongo instance that my app on meteor.com will use?
我正在寻找可以放入settings.json中的内容,或通过其他方式在myapp.meteor.com上为我的流星应用程序设置MONGO_URL
I'm looking for something I could put in my settings.json, or some other way to set MONGO_URL for my meteor app at myapp.meteor.com
推荐答案
流星似乎不支持此功能.我将使用流星应用程序配置包的修改版,将mongo_url var放入settings.json
It looks like meteor doesn't support this. I'm going to use a modified version of the meteor application-configuration package to put my mongo_url var in a settings.json
请参见 https://github.com /meteor/meteor/blob/devel/packages/application-configuration/config.js#L74
packages: {
'mongo-livedata': {
url: process.env.MONGO_URL,
oplog: process.env.MONGO_OPLOG_URL
}
}
更新:
The link above is now broken, here's the updated link: https://github.com/meteor/meteor/blob/c0ea40230e146c6ecd27d1031c50cf2542b60eb7/packages/mongo/remote_collection_driver.js#L29
这篇关于如何让meteor.com应用程序使用外部mongo db的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!