Skip to main content
The MongoDB connector lets your workflows interact with any MongoDB instance, including MongoDB Atlas, self-hosted clusters, and single-node deployments.

Editor experience

Fields that take a MongoDB query, update, or aggregation pipeline (filter, update, pipeline, command, documents, projection, sort) render as a JSON editor; paste or type your queries directly without escaping. Misspelled MongoDB operators are flagged inline with a suggestion. Typing $grater_than shows Did you mean $gt?. Aggregation variables ($$ROOT, $$NOW) and the positional update marker ($) are recognised and never flagged.

Connection setup

You can connect using either a connection string (recommended for Atlas) or individual credentials.
1

Choose your connection method

Option A: Connection String (recommended for MongoDB Atlas):
  • Copy the connection string from your Atlas dashboard (e.g., mongodb+srv://user:pass@cluster.mongodb.net/mydb)
Option B: Individual credentials (for self-hosted or direct connections):
  • Host (e.g., localhost or mongo.example.com)
  • Port (default: 27017)
  • Username and Password
  • Database (optional, default database)
  • Auth Source (optional, authentication database, usually admin)
2

Add the connection in Spojit

Go to Connections in Spojit, click Add Connection, select MongoDB, and enter either:
  • Connection String: Your full MongoDB URI, or
  • Host, Port, Username, Password, Database, and Auth Source fields
MongoDB Atlas: Copy the connection string from your cluster’s Connect dialog. Make sure your IP is in the Atlas network access list.

Common MongoDB settings

Tools

Execute any MongoDB database command such as ping, dbStats, collStats, createUser, etc.
object
required
MongoDB command object.
string
Database to run the command against. Defaults to the connection’s database.
Example request:
Example response:
string
required
Collection name.
object
MongoDB query filter (e.g., { "status": "active" }).
object
Fields to include (1) or exclude (0).
object
Sort order (1 for ascending, -1 for descending).
number
Maximum number of documents to return (default: 100).
number
Number of documents to skip.
Example request:
Example response:
string
required
Collection name.
object[]
required
Array of documents to insert.
Example request:
Example response:
string
required
Collection name.
object
required
Query filter to match documents.
object
required
Update operations using MongoDB operators ($set, $inc, $push, etc.).
boolean
Insert a new document if no match is found (default: false).
Example request:
Example response:
string
required
Collection name.
object
required
Query filter to match documents to delete.
Example request:
Example response:
string
required
Collection name.
object[]
required
Aggregation pipeline stages ($match, $group, $sort, $project, $lookup, etc.).
Example request:
Example response:
List all databases accessible with the current credentials. No parameters required.Example response:
string
Database name. Defaults to the connection’s database.
Example response:
string
required
Collection name.
object
Query filter. Counts all documents if omitted.
Example request:
Example response: