Greetings fellow meteorites!
I need to make some one time mongoDb calls (for the purpose of inserting static data). Ideally the best time would be before startup of server, before logic tries to access data that is not there. What is best practice to include a startup file that makes data calls - in this case - inserts data ?
Thank you so much for you help.
Any input is appreciated!
Alex
You are doing it wrong
Meteor is reactive, which means that if logic can’t access your data, that’s not a problem since when your data is later available, logic will rerun and access it.
So your one time insert can be done when you want, usually in a callback passed to Meteor.startup() http://docs.meteor.com/#/full/meteor_startup
Guys this was a silly question. After reading over the documentation, it appears the best way to do this would be by making use of “Meteor.startup”.
Taken straight from the documentation: