I have a mongoDB collection that is full of documents that look like that:
{
firstName,
lastName,
birthdate,
phone,
email,
hashedPassword,
groups
}
groups is as an array of documents that look like that:
{
gid,
score
}
Whenever a user is added to a group I want to add a new document to the 'groups' (and remove one when he gets out of a group).
How do I do this with Node.js?
Using mongoDB shell its easy cause I can use update with $push but as far as I know I cant use $push with node.js....
Thanks!!