Can you start meteors mongo db without starting the meteor app?

I just want to start the mongo DB to restore a db backup before the app starts. Reasonbeing, the app will trigger a bunch of inserts if it sees the DB is empty

I’m not aware of a command that lets you start Meteor’s MongoDB instance without actually running the app. What I do instead is using a separate MongoDB server installed on my dev machine, and then start the app using the following command (27017 is default port for MongoDB):

MONGO_URL="mongodb://127.0.0.1:27017" meteor

Alternatively, if it’s only a one-off thing and you don’t want to install a separate MongoDB server, you can make use of fact, that Meteor app starts quite slowly, but MongoDB server starts very early in the process. So you can do the following:

  • Open two terminal tabs, type meteor in one, and mongorestore (or whatever command you use to import the dump) in another
  • Execute meteor in the first tab and wait for Started MongoDB message
  • Switch to the other tab and execute the dump import command
1 Like

Hey thanks, I basically went with the second method, woo hoo for a slow build system! :wink:

1 Like