jamesscaggs
jamesscaggs

Reputation: 563

Missing Collections in Local Mongo DB in Meteor App

My Meteor App local mongoDB is missing 2 collections when compared to my live DB on MLab

  1. Already double checked my connection string and am connected to same DB.
  2. This issue just recently started after pulled a new remote branch but nothing was changed related to the DB.

I don't know what else to try.

What other information can I provide to get a good answer here?

Upvotes: 0

Views: 130

Answers (2)

jamesscaggs
jamesscaggs

Reputation: 563

I do not know what was causing the issue but here's what I did to resolve it.

Dump my live database to a local copy: mongodump --host ds15XXXX-a0.mlab.com --db --port 5XXXXX --username --password

Import to local DB: mongorestore --drop --host localhost --port 3001 --db meteor ./dump/

Upvotes: 0

MasterAM
MasterAM

Reputation: 16478

Meteor (or its implementation for MongoDB collections, for that matter) does not actually create the collection until there is a reason for it.

Your collection will not be created in the database until:

  • a document is inserted into it, or
  • an index is created for it.

Upvotes: 2

Related Questions