Im fairly new to Meteor and I am struggling to add top level fields to the users collection. I have followed the meteor guide, however, when I call the method the collection is updated. I know the method is working as when I modify it to be profile.field instead, the field is added to the collection so I am not 100% sure what the problem is.
I was wondering does anyone have a working example of adding top level fields to the user collection?
There may be some other ways to do it but I just initialize any extra fields when the user is first created in Accounts.onCreateUser and just do Meteor.users.update as needed thereafter.
Meteor.users has special built in security, fields won’t be published unless you specifically add them to the fields option in the publish function like this: