Create an API with MongoDB data
Connecting MongoDB to Sparky
Connecting to MongoDB
Sparky supports connecting to managed MongoDB databases, including MongoDB Atlas Clusters. MongoDB Atlas Serverless Instances aren't yet supported.
- In Sparky, go to app.sparky.codes/resources/new/mongodb
- Enter the connection details for your database. You can enter each field individually, or enter a connection string.
Test Connectionto test the connection. This attempts to briefly open a connection with your database server to ensure Sparky can connect.
- When creating a new endpoint, configure a MongoDB query for that endpoint by selecting your MongoDB resource under a
- Write a MongoDB query directly in the endpoint step. They will be executed when this API endpoint is called.
Sparky supports the following MongoDB methods:
Allowlist Sparky's IP Addresses
Sparky connects to your database from the following IP Addresses:
Ensure your database allows inbound TCP connections from these IP addresses on port