MongoDB: Query API

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:

You can use the Query API to perform:

Document Model

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.

Data as Code

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.

Getting Started

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



Consulting Engineer @ MongoDB

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store