2

I am new to Meteor. I downloaded a git repo of a friends project. I want to "initiate" the database, as the local folder is in the .gitignore.

In Rails, it would be something like rake db:setup which would grab all of the migrations and set up the database. How do I do something similar in Meteor? I also see that there are no db, lib, or local folders in the project.

My goal here is to seed the database, for which I am using node-mongo-seeds

Thank you!

1
  • In Meteor, seeding is part of Meteor.startup(). The actual code should be preferably written in imports/startup/server/fixtures.js. I usually indicate seeding should be done for the database by adding a setting called seed=true in settings.json file. Commented Aug 16, 2016 at 16:01

1 Answer 1

1

Meteor does not have an official or structured DB seeding or migrations API as Rails does.

Some apps include code that runs on startup and seed empty collections. Some community packages that perform migrations are no longer maintained.

Note that MongoDB is schemaless, so adding fields to the schema (defined in code, usually via SimpleSchema) is less "traumatic" than in SQL databases, with its pros and cons.

You can try to figure out if the application used one of the migration packages by looking at the package list (by running meteor list or looking at the .meteor/packages file).

There's also a video from a MeteorTLV meetup regarding migrations.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.