I’m a bit confused…
When a user signs up, i’ve added a couple of fields to make a user profile containing name and surname.
After they’ve logged in, the user can update the fields manually by calling the following function:
Meteor.users.update( { _id: Meteor.userId() }, { $set: {profile: {name 'yogi' surname: 'yo'}}} );
However if the user would only like to update one field, the other field would be overwritten and no longer exist in the collection
//surname does no longer exist
Meteor.users.update( { _id: Meteor.userId() }, { $set: {profile: {name 'yogi'}}} );
Is it suppose to be like this or am I missing something?
I understand that $set does what it does but isn’t the whole idea of an update function to only affect the fields you wanted it to?