Docs Menu

Docs HomeDevelop ApplicationsMongoDB DriversC#/.NET

Find Multiple Documents

On this page

  • Example
  • Find Documents by Using Builders
  • Find Documents by Using LINQ
  • Find All Documents
  • Expected Result
  • Additional Information
  • API Documentation

You can retrieve multiple documents from a collection by using the Find() method.

The following example uses Builders to find documents in the restaurants collection with the cuisine "Pizza".

Select the Asynchronous or Synchronous tab to see the corresponding code.

The following example uses LINQ to find documents in the restaurants collection with the cuisine "Pizza".

Select the Asynchronous or Synchronous tab to see the corresponding code.

The following example finds all documents in the restaurants collection.

Select the Asynchronous or Synchronous tab to see the corresponding code.

Running the preceding full examples prints the following results:

Finding documents with builders...:
Number of documents found: 1163
Finding documents with LINQ...:
Number of documents found: 1163
Finding all documents...:
Number of documents found: 25359

Tip

Sample Datasets

These examples use the sample datasets provided by Atlas. The number of documents returned may differ depending on the data in your collection.

To learn more about retrieving documents, see the Retrieve Data guide.

To learn more about using builders, see Operations with Builders.

To learn how to find documents using LINQ, see LINQ.

  • Find()

←  Find a DocumentInsert a Document →