This page shows the driver syntax for several MongoDB commands and links to their related reference and API documentation.
Tip
Using LINQ
You can perform many of the operations on this page using LINQ. For more information on using LINQ with the .NET/C# Driver, see the LINQ Fundamentals page.
Command | Syntax | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Find a Document | | |||||||||||||||||||||||
Find a Document (Async) | | |||||||||||||||||||||||
Find Multiple Documents | | |||||||||||||||||||||||
Find Multiple Documents (Async) | | |||||||||||||||||||||||
Insert a Document | | |||||||||||||||||||||||
Insert a Document (Async) | | |||||||||||||||||||||||
Insert Multiple Documents | | |||||||||||||||||||||||
Insert Multiple Documents (Async) | | |||||||||||||||||||||||
Update a Document | | |||||||||||||||||||||||
Update a Document (Async) | | |||||||||||||||||||||||
Update Multiple Documents | | |||||||||||||||||||||||
Update Multiple Documents (Async) | | |||||||||||||||||||||||
Update an Array in a Document | | |||||||||||||||||||||||
Replace a Document | | |||||||||||||||||||||||
Replace a Document (Async) | | |||||||||||||||||||||||
Delete a Document | | |||||||||||||||||||||||
Delete a Document (Async) | | |||||||||||||||||||||||
Delete Multiple Documents | | |||||||||||||||||||||||
Delete Multiple Documents (Async) | | |||||||||||||||||||||||
Access Data from a Cursor Iteratively | | |||||||||||||||||||||||
Count Documents | | |||||||||||||||||||||||
List the Distinct Documents or Field Values | | |||||||||||||||||||||||
Limit the Number of Documents Retrieved | | |||||||||||||||||||||||
Skip Retrieved Documents | | |||||||||||||||||||||||
Sort the Documents When Retrieving Them | | |||||||||||||||||||||||
Project Document Fields When Retrieving Them | | |||||||||||||||||||||||
Create an Index | |