How to create a default user on meteor?

前端 未结 4 769
感动是毒
感动是毒 2021-02-19 03:39

I want to create an admin user if no users exist. I tried it on a js file inside the server folder

Meteor.startup(function () {
  if(!Meteor.users.find().count()         


        
4条回答
  •  無奈伤痛
    2021-02-19 04:13

    After some time, I tested again the above code with meteor 0.6.4 and it worked without problem. Probably was an issue with meteor 0.6.1 or I accidentally solved the problem somewhere in the code.

提交回复
热议问题