MongoDB C# docs
GitHub.NET DriverMongoDB docs
  • ⭐Introduction
  • πŸ“ŒGetting started
    • Environment setup
    • πŸƒβ€β™‚οΈ Quick start
      • MongoDB connection
      • Databases
      • Collections
      • Insert documents
      • Read documents
      • Update documents
  • πŸ“‘CRUD Basics
    • βž•Create
      • Id Member
      • Ordered insert
    • πŸ”ŽRead
      • Basics
      • Comparison Operators
      • Logical Operators
      • Element Operators
      • Array operators
      • Evaluation Operators
    • πŸ“Update
      • Operators
      • Replace
      • Arrays
    • ❌Delete
  • πŸ§ͺAggregation
    • Overview
    • βœ‚οΈProject
    • 🎯Match
    • πŸ“¦Group
    • 🚩Unwind
    • ⏩Pagination
    • πŸ“ˆBucket
    • ✨Operators
Powered by GitBook
On this page
  • Do you like shortcuts?
  • Install Nuget packages
  • dotnet CLI
  • Visual Studio
  • Nuget Package Manager
  1. πŸ“ŒGetting started

πŸƒβ€β™‚οΈ Quick start

Run Forrest run!

PreviousEnvironment setupNextMongoDB connection

Last updated 5 years ago

Do you like shortcuts?

If the answer is yes then you are on the right page. Quick start section can help you get your hands dirty right on as it contains samples with the most common CRUD operations when dealing with any database. You will learn step by step how to:

  1. Connect to a MongoDB instance

  2. List all databases existing in the instance

  3. List all collections existing in a specific database

  4. Insert one or many documents at once in a collection

  5. Search for and read documents from a collection

  6. Update one or more documents in a collection

Quick start is recommended for those who have never used the MongoDB .NET driver

Install Nuget packages

dotnet CLI

dotnet add package MongoDB.Driver

Visual Studio

Open the Nuget Package Manager, search for and install the package.

Nuget Package Manager

Install-Package MongoDB.Driver

To start writing MongoDB queries using C# , you need to install the MongoDB.Driver Nuget package in your project with one of the following ways:

🚘
βž•
βž–
πŸ“
❌
Quick Start with MongoDB .NET driver