开发过程中的流星自定义mongodb [英] Meteor custom mongodb during development
问题描述
我将如何使用(实时运行的)MongoDB开发另一个流星应用程序?我尝试在运行meteor
之前修改(.meteor/server/server.js
)并指定MONGO_URL
无用.
How would I use a (live running) MongoDB to develop another meteor app? I tried modifying (.meteor/server/server.js
) and specifying MONGO_URL
to no avail before running meteor
.
这无需使用捆绑的MongoDB,它必须是一个单独的/自定义的(基本上是另一个流星实例).
This is without using the bundled MongoDB, it has to be a separate/custom one (basically of another meteor instance).
这可以通过部署方法完成,但是在开发过程中正常的meteor run
呢?
This can be done with the deploy method but what about the normal meteor run
during development?
更新:这确实有效,但是客户端实现似乎有点毛病
UPDATE: this does work however the client side implementation seems a bit glitchy
推荐答案
As mentioned in the Unofficial Meteor FAQ, you can invoke Meteor with the MONGO_URL
environment variable set to the desired instance:
MONGO_URL=mongodb://localhost:27017 meteor
如果您的MongoDB处理多个数据库,则可以通过将其附加到URL来指明要使用哪个数据库:
If your MongoDB handles multiple databases, you can indicate which one to use by appending it to the URL:
MONGO_URL=mongodb://localhost:27017/mydb meteor
您甚至可以通过运行以下命令阻止Meteor在开发中启动本地Mongo实例:
You can even prevent Meteor from starting a local Mongo instance in development by running:
MONGO_URL=none meteor
这篇关于开发过程中的流星自定义mongodb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!