I have a Meteor application with the following fixtures code:
/imports/startup/server/fixtures.js
import { Meteor } from 'meteor/meteor'
import { Accounts } from 'meteor/accounts-base'
if(Meteor.users.find().count === 0) {
const users = [
{username: "admin", email: "admin@testing.demo", profile: { name: "Admin" }, roles: ["admin"]},
{username: "school", email: "school@testing.demo", profile: { name: "School Name" }, roles: ["school"]},
{username: "teacher", email: "teacher@testing.demo", profile: { name: "Teacher" }, roles:["teacher"]}
]
for(let user of users) {
Accounts.createUser({
username: user.username,
email: user.email,
password: "123456",
profile: {
name: user.profile.name,
},
roles: user.roles
})
}
}
On starting up my project all the accounts are created successfully except none of them have the roles field. What am I doing wrong?