We need to add the MongoDB client API to our project. The best way to do this is by adding the NuGet package. We can do this as follows:
- Right-click on your project and select Manage NuGet Packages... from the context menu, as shown in the following screenshot:
- On the NuGet screen, select the Browse tab and enter Mongodb.Driver as the search term.
- Select the MongoDB.Driver by MongoDB option.
- Click on the Install button to add the latest stable package to your project. This is shown in the following screenshot:
- You can view the progress in the Output window of Visual Studio.
- After MongoDB has been added to ...