const mongo = client.db("demo-cluster")
const col = mongo.collection("samples")
col.aggregate([
{
$addFields:
{ "date": Date.now() }
}
])
The above code is supposed to edit my collection called “samples” and then add the field “date” to them with the value in Unix time. However, nothing is changing in my database. What am I missing about this?