Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I share MongoDB collections between Meteor apps?

Tags:

I'd like to be able to have an admin app and a client app for my project. Ideally, I'd like to be able to have a shared MongoDB collection. How would I be able to accomplish this?

I tried creating collections with the same name in two different apps, but found that Meteor will keep the data separate. Any idea what I can do? Thanks.

like image 739
Sam Avatar asked Oct 29 '12 04:10

Sam


1 Answers

export MONGO_URL=mongodb://localhost:3002/meteor

Then run meteor app, it will change the default database meteor uses. So share databases or collections won't be a problem! For administrative reason, I would use a individual MongoDB server managed by myself other than using meteor's internal MongoDB.

like image 131
Aaron Wang Avatar answered Sep 18 '22 15:09

Aaron Wang