Connecting to the MongoDB database is a paid feature. Check Pricing Details to learn more.
MongoDB is a document-oriented database management system belonging to non-relational databases (NoSQL). It aims to provide scalable high-performance data storage solutions for web applications. Unlike relational databases (SQL), MongoDB does not use SQL statements to operate on the database, but uses database commands (Database Commands) or simpler and more user-friendly methods of adding, deleting, querying and modifying data. Further reading: MongoDB Documentation.
When adding database operations, click Database Connetions and select Manage Database Connection.
2.
Click the "New" button in the upper right corner.
3.
Select MongoDB database type, then fill in the corresponding connection information.
TIP
Apidog attaches importance to your data security. The database address, port, username, password, database name are only stored locally on the client and will not be synced to the cloud. Even within the same team, connection information for databases will not be synced between members. Each team member needs to manually set up the database connection.
MongoDB stores document data in BSON format. In Apidog, you can directly use standard MongoDB query syntax—such as new Date(...) or ObjectId(...)—to write query filters and update conditions, enabling more precise control over data types.For example, suppose your MongoDB database contains the following BSON document:
For common CRUD operations, support via visual API operations. No need to write any JavaScript code, just specify the action in the "Operation Type", then specify the "Collection Name", and then write the corresponding content in JSON in "Query Conditions".For example, for the query operation mentioned above, you can view the queried document in the console after entering the command and enabling "Console Log".
To support more advanced query requirements, you can also use BSON data type expressions in your query conditions, fully compatible with official MongoDB syntax.For example, the following query condition is valid:
Supported BSON types include (but are not limited to):
If you need more advanced operations, you can also directly run database commands. In "Operation Type", select "Run Database Command" and then enter the database command in JSON format. Note that the database command does not refer to method calls like db.collection.findOne(), but JSON data in a specific format.For example, to query the number of documents in the users collection, you can use the count database command:
{"count":"users"}
After entering the command, you can view the result in the console.