Docs Menu
Docs Home
/ /

MongoDB C# Driver

Welcome to the documentation site for the official MongoDB .NET/C# Driver. You can add the driver to your application to work with MongoDB in C#. Download the driver using NuGet, or set up a runnable project by following our Quick Start guide.

For documentation on versions of the driver v2.18 and earlier, see the Previous Versions section.

You can use the .NET/C# Driver to connect to MongoDB deployments running on one of the following hosted services or editions:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

  • MongoDB Enterprise: The subscription-based, self-managed version of MongoDB

  • MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB

Learn how to establish a connection to MongoDB Atlas and begin working with data in the Quick Start section.

See driver syntax examples for common MongoDB commands in the Quick Reference section.

For a list of new features and changes in each version, see the What's New section.

For fully runnable code snippets and explanations for common methods, see Usage Examples.

For detailed information on key concepts of using the .NET/C# Driver, see Fundamentals.

For detailed information about types and methods in the .NET/C# Driver, see the MongoDB .NET/C# Driver API documentation.

Banner for the C# MongoDB University Course

Using MongoDB with C#

Learn the essentials of C# & ASP.NET application development with MongoDB.

For answers to commonly asked questions about the MongoDB .NET/C# Driver, see the FAQ section.

For solutions to issues you might encounter when using the driver to connect to a MongoDB deployment, see the Connection Troubleshooting section.

Learn how to report bugs, contribute to the driver, and find additional resources for asking questions in the Issues & Help section.

For the compatibility charts that show the recommended .NET/C# Driver version for each MongoDB Server version, see Compatibility.

Learn what changes you may need to make to your application to upgrade driver versions in the Upgrade Driver Versions section.

The MongoDB Entity Framework Provider is an object-relational mapper (ORM) that lets you use Microsoft's Entity Framework to work with MongoDB data. ORMs provide an object-oriented interface for data management.

To learn more, see the MongoDB Entity Framework Provider documentation.

The C# Analzyer is a tool that helps you understand how your .NET/C# Driver code translates into the MongoDB Query API and if your code includes any unsupported LINQ or builder expressions. To learn more, see the C# Analzyer documentation.

Next

Previous Versions