I'm trying to store a string values in MongoDB, here is the C# code that I'm currently using:
var filter = Builders<BsonDocument>.Filter.Eq("_id", "pk-0");
var update = Builders<BsonDocument>.Update.Push("address", "MyStreet 1");
update = update.AddToSet("Address 2", "MyStreet 2");
await Collection.UpdateOneAsync(filter, update, new UpdateOptions { IsUpsert = true });
Weirdly, both AddToSet() and Push() methods creates an array1 with a string value inside it instead of just a string, see the screenshot below from my Admin UI that shows the result from my code.
Any idea of how I can get my code to store the string directly without putting it inside an array?
