I have a list of strings I want to update in MongoDB using C# driver. How do I do this?
List<string> Images = someList;
var update = Update.Set("Images", Images);
collection.Update(query, update, UpdateFlags.Upsert);
this will give me an error saying that ‘Images’ is not BsonValue.. How do I convert string list to the bsonvalue? Thanks
That’s what I did to solve it: I converted that list to BsonArray: