Docs Menu
Docs Home
/
MongoDB Manual
/

MongoDB Query API

On this page

  • Document Model
  • Data as Code
  • Getting Started

The MongoDB Query API is the mechanism that you use to interact with your data.

The Query API comprises two ways to query data in MongoDB:

  • CRUD Operations

  • Aggregation pipelines

You can use the Query API to perform:

A document in MongoDB is a data structure composed of field and value pairs. Documents are stored as BSON which is the binary representation of JSON. This low level of abstraction helps you develop quicker and reduces the efforts around querying and data modeling. The document model provides several advantages, including:

  • Documents correspond to native data types in many programming languages.

  • Embedded documents and arrays reduce need for expensive joins.

  • Flexible schema. Documents do not need to have the same set of fields and the data type for a field can differ across documents within a collection.

The MongoDB Query API supports drivers for major programming languages. These drivers allow you to make calls to the database and generate queries using the syntax native to your application.

To get started, visit the MongoDB Getting Started Guide. Here you can find resources, code examples and tutorials that demonstrate the MongoDB Query API.

Back

Documents

Next

BSON Types