Is it possible to insert an array of a user's links into the current user's profile?
I attempted the following on the client side, but it did not work:
Meteor.users.update( {_id: Meteor.userId()}, {
$set: {
profile: {
userlinks: {
owned: "_entry_id"
}
}
}
});
I also tried using insert instead of update, but with no success.
I have some ideas about what could be causing the issue:
- Possibly, I am not setting the mongodb permissions correctly (least likely)
- It is possible that I am not publishing the user collection correctly (since I currently don't publish it at all) and maybe Meteor doesn't do this automatically (somewhat likely)
- Insert might be the correct command, but limited to the server. Therefore, I may need to place the insert function inside a Meteor method on the server and then call that method from the client (more likely)
Or perhaps, I just lack understanding of what I am doing (most likely)