I must admit I am not exactly sure what is going on inside of the mongodbclient function update. In my code I currently have this:

```
app.post('/update', function(req, res) {
  const params = req.body;

  const newData = {
    id: params.id,
    data: params.data
    a ton more fields will go here
  };

  db.collection('datas').update({id : params.id}, 
      { $set: {data : newData.data}}, (err, data) => {
            if (!err) {
              res.send({err: false});
            } else {
              res.send({err: true});
            }
 });

```

However I dont have the slightest idea what the whole $set bracket is doing or how I could modify it to override the entire document once there are a ton more fields on the incoming data. I suppose the id field really wont need to be updated but you can get the idea.

What is that bracket doing? And how can I customize it for my needs?