This kind of question has been asked before: How can I share MongoDB collections between Meteor apps?
However, the answer is not clear.
I need to have a Meteor public app and the Administration app separate (for many reasons, but mainly security and code management).
Using the accepted answer: export MONGO_URL=mongodb://localhost:3002/meteor seems reasonable, but below another user 'matthias' points out "When connecting from another app, events that trigger changes in the model would not be transported across those applications. The mongoDB instance itself of course isn't aware of that."
How does one trigger the 'other' meteor app to reevaluate the events/triggers from the MongoDB? Meaning simply if I make a change in the administration module, how can I make the public site reflect those changes? Assuming that is what was meant. Also is there any other functionality that will be lost by this method?
Thanks
The answer is that you don't have to do anything. As long as the apps use the same database (as identified by the MONGO_URL
), they will respond reactively to changes in the data.
In fact separating your app into a front-end and a back-end is a good strategy, as outlined in this video, Why you should split your meteor app.
You can even use the mongo
shell to update/insert/delete documents in the database, and the publications will pick them up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With