The MongoDB Data API provides REST-like access to your data in MongoDB Atlas, a MongoDB database-as-a-service.
For full documentation, visit the MongoDB Data API documentation website.
-
Create a free MongoDB Atlas cluster. Choose the dataset sample if you need sample data.
-
Fork this collection into your workspace for use with your variables.
-
Copy the Data API URL endpoint from the Atlas UI and paste it into the 'URL_ENDPOINT' collection variable.
-
Create a new API key in the Atlas UI, copy the value, and paste it into the 'API_KEY' collection variable.
For writes, use the 'CONTENT_TYPE' variable set to either 'json' or 'ejson' in the Content-Type header.
For reads, the Data API defaults to JSON but can be changed to EJSON by setting the Accept header. Adjust the 'ACCEPT_TYPE' variable to 'json' or 'ejson' to control the Accept header in Postman requests. The default content type in Atlas can also be changed in the Atlas Admin UI.
Fill in other variables with your cluster, database, and collection names.
Now you can explore endpoints and perform CRUD operations on your collection using the MongoDB Data API.