Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load MongoDB from dump #159

Open
veered opened this issue Jan 8, 2016 · 11 comments
Open

Load MongoDB from dump #159

veered opened this issue Jan 8, 2016 · 11 comments
Labels

Comments

@veered
Copy link
Contributor

veered commented Jan 8, 2016

I'd like to be able to load fixtures generated by mongodump for my tests to use. Any idea what the best way to do this is?

@apendua
Copy link
Member

apendua commented Jan 9, 2016

This is a good idea. Actually, I've been already thinking about adding this feature.

@apendua apendua added the feature label Jan 9, 2016
@veered
Copy link
Contributor Author

veered commented Jan 9, 2016

Is there a way of doing that now? Or at least connecting to an existing database for tests instead of provisioning a new one?

@apendua
Copy link
Member

apendua commented Jan 9, 2016

@veered You can try passing mongoUrl parameter to the meteor() function, something like:

var server = meteor({
   mongoUrl: 'mongodb://127.0.0.1:27017/myDatabase'
});

Please let me know if it helps.

@veered
Copy link
Contributor Author

veered commented Jan 11, 2016

I tried that syntax and it appears that Gagarin still creates a new database. What part of the codebase should I be looking at to figure this out?

@veered
Copy link
Contributor Author

veered commented Jan 11, 2016

Looks like we need to pass in mongoUrl to makeMongoDB in interface.js. That did the trick for me. I would guess that dbPath used to be the correct option but was changed during a refactor.

@veered
Copy link
Contributor Author

veered commented Jan 12, 2016

Would you like for me to open up a pull request?

@apendua
Copy link
Member

apendua commented Jan 12, 2016

@veered Yes, please.

@veered
Copy link
Contributor Author

veered commented Jan 12, 2016

Here's the pull request #160

@apendua
Copy link
Member

apendua commented Jan 13, 2016

@veered Thanks! I will look into this.

@woleEkanola
Copy link

How do I load mongo db from dump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants