I have a class that stores the following data:
public class User
{
public ObjectId _id { get; set; }
public string Name { get; set; }
public string Pass { get; set; }
public Dictionary<string, Tuple<string, string>> Quests { get; set; }
}
New Users are instantiated with this:
await collection.InsertOneAsync(new User { Name = u, Pass = p,
Quests = new Dictionary<string,Tuple<string,string>>() });
I know how to find and pull information from created documents, but I don't know how to push and save changes to documents. Most of the answers online are for the old Mongodb C# driver, so things like Query
or .save()
don't exist, or I didn't include the right packages into my program.
I want to be able to add and remove entries to the Dictionary and then save the changes to the document. Any suggestions?
See Question&Answers more detail:os