Skip to content

Instantly share code, notes, and snippets.

@sandrabosk
Created May 5, 2020 02:12
Show Gist options
  • Save sandrabosk/964991157b6fef60e6c1bd67a2b51edb to your computer and use it in GitHub Desktop.
Save sandrabosk/964991157b6fef60e6c1bd67a2b51edb to your computer and use it in GitHub Desktop.

Seed mLab from a dev database

Your MONGODB_URI should look somewhat like this:

mongodb://heroku_3vf5zhlq:[email protected]:41218/heroku_3vf5zhlq

where this is the pattern:

mongodb://user:pass@host:port/db

This being said, these are the parts we need:

user: heroku_3vf5zhlq

pass: gjavjbqb119nu1e12l1481je5

host: ds141218.mlab.com

port: 41218

db: heroku_3vf5zhlq

Now try to put them together in this format:

mongo host:port/db -u user -p pass yourSeeds.js

and run this in your terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment