if (Meteor.users.find().count() === 0) {
  console.log("Creating New Users:");

  var users = [
    {name: "Admin", email: "admin@sdsn.org", roles: ['admin']},
    {name: "Handbook Admin", email: "handbookAdmin@sdsn.org", roles: ['blogAdmin']},
    {name: "Handbook Editor", email: "handbookEditor@sdsn.org", roles: ['blogAuthor']},
  ]

  _.each(users, function(userData) {
    var id,
      user;

    console.log(userData);

    id = Accounts.createUser({
      email: userData.email,
      password: "123456",
      profile: { name: userData.name }
    });

    Roles.addUsersToRoles(id, userData.roles);
  });
}

var glossary = [
  {
    "acronym":"CGDEV",
    "fullname":"Center for Global Development"
  },
  {
    "acronym":"COP21",
    "fullname":"Conference of Parties"
  },
  {
    "acronym":"DAC",
    "fullname":"Development Assistance Committee "
  },
  {
    "acronym":"DIIS",
    "fullname":"Danish Institute for International Studies"
  },
  {
    "acronym":"EU",
    "fullname":"European Union"
  },
  {
    "acronym":"FDI",
    "fullname":"Foreign Direct Investment"
  },
  {
    "acronym":"FfD",
    "fullname":"Financing for Development"
  },
  {
    "acronym":"FfDO",
    "fullname":"Financing for Development Office"
  },
  {
    "acronym":"FSD",
    "fullname":"Financing Sustainable Development"
  },
  {
    "acronym":"G77",
    "fullname":"The Group of 77"
  },
  {
    "acronym":"GCF",
    "fullname":"Green Climate Fund"
  },
  {
    "acronym":"GEF",
    "fullname":"Global Environmental Facility"
  },
  {
    "acronym":"GFATM",
    "fullname":"The Global Fund to Fight AIDS, Tuberculosis and Malaria"
  },
  {
    "acronym":"GHG",
    "fullname":"greenhouse gas"
  },
  {
    "acronym":"GNI",
    "fullname":"Gross National Income"
  },
  {
    "acronym":"HDI",
    "fullname":"Human Development Index"
  },
  {
    "acronym":"IAEG",
    "fullname":"Inter-Agency and Expert Group on MDG Indicators"
  },
  {
    "acronym":"IBGE",
    "fullname":"Instituto Brasileiro de Geografia e Estatístico (Brazilian Institute of Geography and Statistics)"
  },
  {
    "acronym":"ICDR",
    "fullname":"Incremental Capital Output Ratio"
  },
  {
    "acronym":"ICEFSD",
    "fullname":"Intergovernmental Committee of Experts on Financing for Sustainable Development"
  },
  {
    "acronym":"ICESDF",
    "fullname":"Intergovernmental Committee of Experts on Sustainable Development Finance"
  },
  {
    "acronym":"IDDRI",
    "fullname":"The Institute for Sustainable Development and International Relations"
  },
  {
    "acronym":"IEA",
    "fullname":"International Energy Agency"
  },
  {
    "acronym":"IEAG",
    "fullname":"Independent Expert Advisory Group "
  },
  {
    "acronym":"IFAD",
    "fullname":"International Fund for Agricultural Development"
  },
  {
    "acronym":"INDC",
    "fullname":"Intended Nationally-Determined Contributions"
  },
  {
    "acronym":"IPCC",
    "fullname":"Intergovernmental Panel on Climate Change"
  },
  {
    "acronym":"LDCs",
    "fullname":"Least Developed Countries"
  },
  {
    "acronym":"LLDCs",
    "fullname":"Landlocked Developing Countries"
  },
  {
    "acronym":"MDGs",
    "fullname":"Millenium Development Goals "
  },
  {
    "acronym":"MSL",
    "fullname":"Multple Sustainable Land-Use"
  },
  {
    "acronym":"NCSD",
    "fullname":"National Council or Commission for Sustainable Development"
  },
  {
    "acronym":"NDDP",
    "fullname":"National Deep Decarbonization Pathway"
  },
  {
    "acronym":"NDMC",
    "fullname":"Nationally-Determined Mitigation Contributions"
  },
  {
    "acronym":"NSDS",
    "fullname":"National Sustainable Development Strategy "
  },
  {
    "acronym":"NSDV",
    "fullname":"National Sustinable Development Vision"
  },
  {
    "acronym":"NSO",
    "fullname":"National Statistics Office"
  },
  {
    "acronym":"NSS",
    "fullname":"National Statistical System"
  },
  {
    "acronym":"ODA",
    "fullname":"Official Development Assistance "
  },
  {
    "acronym":"OECD",
    "fullname":"Organization for Economic Cooperation and Development"
  },
  {
    "acronym":"OOF",
    "fullname":"Other Official Flows"
  },
  {
    "acronym":"OWG",
    "fullname":"Open Working Group on Sustainable Development Goals"
  },
  {
    "acronym":"PPP",
    "fullname":"Public Private Partnership"
  },
  {
    "acronym":"R&D",
    "fullname":"Research and Development"
  },
  {
    "acronym":"Rio+20",
    "fullname":"United Nations Conference on Sustainable Development Rio+20"
  },
  {
    "acronym":"SDGs",
    "fullname":"Sustainable Development Goals"
  },
  {
    "acronym":"SDSN",
    "fullname":"Sustainable Development Solutions Network"
  },
  {
    "acronym":"SIDS",
    "fullname":"Small Island Developing States"
  },
  {
    "acronym":"STEEPLE",
    "fullname":"Society, Technology, Environment, Economics, Politics, Legal, Ethical Framework"
  },
  {
    "acronym":"STD",
    "fullname":"Sustainable Technology Development"
  },
  {
    "acronym":"UN",
    "fullname":"United Nations"
  },
  {
    "acronym":"UNCT",
    "fullname":"United Nations Country Team"
  },
  {
    "acronym":"UNDP",
    "fullname":"United Nations Development Programme"
  },
  {
    "acronym":"UNFCCC",
    "fullname":"United Nations Framework Convention on Climate Change"
  },
  {
    "acronym":"UNSD",
    "fullname":"United Nations Statistics Division"
  },
  {
    "acronym":"UN SDGs Summit",
    "fullname":"United Nations Summit for the Adoption of the Post-2015 Development Agenda "
  },
  {
    "acronym":"WHO",
    "fullname":"World Health Organization"
  },
  {
    "acronym":"WSSD",
    "fullname":"World Summit for Sustainable Development"
  },
  {
    "acronym":"IISD",
    "fullname":"International Institute for Sustainable Development"
  }
];

if (Glossary.find().count() === 0) {
  _.each(glossary, function(obj) {
    console.log('Inserting to Glossary', obj);
    Glossary.insert(obj);
  })
}