From the client, I am able to pass the relevant _id (variable id is JPDCv6Wn6D94KSzMD for this example) of the particular object onto the method, along with a context variable that contains some words. I then wish to set the 'context' field with the context variable.
The summary object is located in meteor.user.profile
summary: Object
_id: "JPDCv6Wn6D94KSzMD"
context: ""
The method: (the method attempts to update the 'summary' object but the function is not correct)
Meteor.methods({
contentUpdate: function (context, id){
Meteor.users.update({_id:this.userId, //some function)}
}
});
The update method is what I'm having trouble with.
Meteor.user(); console log:
Meteor.user();
Object {_id: "YZEBzkGZsny668N8o", emails: Array[1], profile: Object, username: "Mr.A"}
_id: "YZEBzkGZsny668N8o"
emails: Array[1]
profile: Object
name: "Mr A"
summary: Object
_id: "JPDCv6Wn6D94KSzMD"
context: ""
__proto__: Object
__proto__: Object
username: "Mr.A"
__proto__: Object