Update List<string> in mongoDB
问题 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 回答1: It looks like Update.Set is wanting a BsonValue and you can't implicitly convert from List to BsonValue. You look like you are doing Upserts anyway, could