MongoDB with C# and .NET 9 — 3/16: Saving an Object to MongoDB from C# (Part 2)

Giovanni Pace

Description

Let's save our first object to MongoDB from C#: I'll configure the connection string, obtain a reference to the collection, and use InsertOne to insert a document, verifying the result in Compass.