I have a collection in MongoDB called "Users". Here, I want to update two specefic documents with different values on request. So far, I have succeded with selecting them both, but I can't seem to find a way to specefy the values. I can only give them the same value. Here is what I have so far:
db.db(DBName).collection("Users").updateMany(
{id: {$in: [1, 2]}},
{$set: {Value: "test"}}
This works fine but both of them of cause gains the value "test". Is there a way to specefy what the id: 1 gains the value "test1" and the id: 2 gains the value "test2"?