Meteor reset on Heroku

断了今生、忘了曾经 提交于 2020-01-03 10:41:33

问题


What is the best way to redeploy an alpha version on Heroku, and perform a meteor reset for the server mongo fixtures to be re-executed on the server?


回答1:


Couldn't find a good solution. So I need to go in my heroku mongohq interface, and manually remove all collections, then restart heroku.




回答2:


I resolved this with a custom method for any hosting(only debug, not in Production):

in /server/reset.js

 Meteor.methods({
   resetear: function() {

     Collection1.remove({});
     Collection2.remove({});
     //And Update Any Collection 3, Flush array embeded
     Collection3.update({},{$set:{'usersenrol':[]}},{'multi':true});

   }
});

And then, in the Client Console:

Meteor.call('resetear')


来源:https://stackoverflow.com/questions/21962602/meteor-reset-on-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!