← MongoDB

Execute Aggregation with MongoDB API

Pipedream makes it easy to connect APIs for MongoDB and 2,800+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Execute Aggregation with the MongoDB API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
8 min
Watch now ➜

Trusted by 1,000,000+ developers from startups to Fortune 500 companies

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

Create a workflow to Execute Aggregation with the MongoDB API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Execute Aggregation action
    1. Connect your MongoDB account
    2. Select a Database
    3. Select a Collection
    4. Configure Pipeline
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Integrations

Execute Aggregation with MongoDB API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Submission from Typeform API
Typeform + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Submission (Instant) from Jotform API
Jotform + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Scheduled Tasks from Pipedream API
Pipedream + MongoDB
 
Try it
Execute Aggregation with MongoDB API on npm Download Counts from npm API
npm + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Activity Created Event from Strava API
Strava + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Account Created from Zoom Admin API
Zoom Admin + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New or Removed Documents in a Collection from Fauna API
Fauna + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New or changed appointments from SuperSaaS API
SuperSaaS + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Deploy Failure (Instant) from Netlify API
Netlify + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Form Submission (Instant) from Formstack API
Formstack + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Stories for a Tag from Dev.to API
Dev.to + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Weather for ZIP Code from HERE API
HERE + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Cancelled Event from Google Calendar API
Google Calendar + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Comments by Keyword from Hacker News API
Hacker News + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Account Created from Apollo.io API
Apollo.io + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Action Created from iAuditor by SafetyCulture API
iAuditor by SafetyCulture + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Agency Listing Updated from Domain Group API
Domain Group + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Appointment Cancelled from TidyCal API
TidyCal + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Asset Uploaded from Shotstack API
Shotstack + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Assignment Done from Google Classroom API
Google Classroom + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Balance Updated from Mocean API API
Mocean API + MongoDB
 
Try it
Execute Aggregation with MongoDB API on BigQuery - New Row from Google Cloud API
Google Cloud + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Bill State Updated (Instant) from Clio - Australia API
Clio - Australia + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Bill State Updated (Instant) from Clio - Canada API
Clio - Canada + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Bill State Updated (Instant) from Clio - EU API
Clio - EU + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Bill State Updated (Instant) from Clio - US API
Clio - US + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Booking Cancelled from Cal.com API
Cal.com + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Booking Contact Updated from Slottable API
Slottable + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Box Changed Pipeline (Instant) from Streak API
Streak + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Budget Snapshot Event (Instant) from Procore API
Procore + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Call Ended (Instant) from Rinkel API
Rinkel + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Cancelled Booking with Customer from Appointedd API
Appointedd + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Candidate Created (Instant) from Recruit CRM API
Recruit CRM + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Card Archived (Instant) from Trello API
Trello + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Card Created (Instant) from Pipefy API
Pipefy + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Catalog Item Updated from Square API
Square + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Category Overspent from You Need a Budget API
You Need a Budget + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Changed Task Status from Yanado API
Yanado + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Changes to Specific Files (Shared Drive) from Google Drive API
Google Drive + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Chat Ended (Instant) from tawk.to API
tawk.to + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Chat Status Updated from HelpCrunch API
HelpCrunch + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Client Updated from Paymo API
Paymo + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Client Updated from RiskAdvisor API
RiskAdvisor + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Collection Item Updated from Webflow (v2) API
Webflow (v2) - do not use + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Company Updated from HubSpot API
HubSpot + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Completed Document (Instant) from signNow API
signNow + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Contact Activated from Vision6 API
Vision6 + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Contact Created from Mailjet API
Mailjet + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Contact Deleted (Instant) from SmashSend API
SmashSend + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Contact Joins Vault (Instant) from AttractWell API
AttractWell + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Contact Status Updated from Ambivo API
Ambivo + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Contact Updated from ProWorkflow API
ProWorkflow + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Custom Events (Instant) from Zoom API
Zoom + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Customer Card Expired (Instant) from Chargebee API
Chargebee + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Customer Created (Instant) from Customer Fields API
Customer Fields + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Customer Created from Plain API
Plain + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Customer Updated (Instant) from Loyverse API
Loyverse + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Customer Updated (Instant) from Orderspace API
Orderspace + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Daily schedule from Schedule API
Schedule + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Dataset Refresh Completed from Microsoft Power BI API
Microsoft Power BI + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Deleted Issue (Instant) from Taiga API
Taiga + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Deleted Record from Insightly API
Insightly + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Document Completed from Crove API
Crove + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Document Creation Failed (Instant) from PandaDoc API
PandaDoc + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Document Export Failed from Cloudpress API
Cloudpress + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Document Sent (Instant) from Signaturely API
Signaturely + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Donation Refunded from Raisely API
Raisely + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Edit Event (Instant) from WaiverFile API
WaiverFile + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Entitlement Threshold Reached (Instant) from Paigo API
Paigo + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Envelope Sent or Complete from Docusign API
Docusign + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Envelope Sent or Complete from Docusign Developer API
Docusign Developer + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Event Created from Team Up API
Team Up + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Event Start from Teamup API
Teamup + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Event Updated (Instant) from Add to Calendar PRO API
Add to Calendar PRO + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Exchange Rate Updated from CurrencyScoop API
CurrencyScoop + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Expense Created from Splitwise API
Splitwise + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Expense Report Approved from Zoho Expense API
Zoho Expense + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Failed Monitor from Drata API
Drata + MongoDB
 
Try it
Execute Aggregation with MongoDB API on File Deleted from DigitalOcean Spaces API
DigitalOcean Spaces + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Form Created from 123FormBuilder API
123FormBuilder + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Import Needs Review from Dromo API
Dromo + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Incident Updated (Instant) from Statuspage API
Statuspage + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Inventory Object Updated from Booking Experts API
Booking Experts + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Inventory Updated from Lightspeed Retail POS API
Lightspeed Retail POS + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Inventory Updated from Sellercloud API
Sellercloud + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Issue Created from PractiTest API
PractiTest + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Issued Credential from Accredible API
Accredible + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Item Position Changed from Miro Developer App API
Miro Developer App + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Job Failed (Instant) from Cloud Convert API
Cloud Convert + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Job Run Completed (Instant) from dbt Cloud API
dbt Cloud + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Label Updated (Instant) from Loop Returns API
Loop Returns + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Lead Details Updated from CINC API
CINC + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Lesson Completed (Instant) from Thinkific API
Thinkific + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Listing Updated from Etsy API
Etsy + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Member Created from Patreon API
Patreon + MongoDB
 
Try it
Execute Aggregation with MongoDB API on Message Deleted (Instant) from Discord API
Discord + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New 2Captcha Balance Updated from twocaptcha API
twocaptcha + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Abandoned Cart from Shopify Developer App API
Shopify + MongoDB
 
Try it
Execute Aggregation with MongoDB API on New Abandoned Cart from Stripe API
Stripe + MongoDB
 
Try it

Details

This is a pre-built, source-available component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Execute Aggregation on MongoDB
Description:Execute an aggregation pipeline on a MongoDB collection. [See the documentation](https://www.mongodb.com/docs/drivers/node/current/fundamentals/aggregation/)
Version:0.0.2
Key:mongodb-execute-aggregation

Code

import app from "../../mongodb.app.mjs"; import utils from "../../common/utils.mjs"; export default { key: "mongodb-execute-aggregation", name: "Execute Aggregation", description: "Execute an aggregation pipeline on a MongoDB collection. [See the documentation](https://www.mongodb.com/docs/drivers/node/current/fundamentals/aggregation/)", version: "0.0.2", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: false, }, type: "action", props: { app, database: { propDefinition: [ app, "database", ], }, collectionName: { propDefinition: [ app, "collection", ({ database }) => ({ database, }), ], }, pipeline: { type: "string[]", label: "Pipeline", description: "The aggregation pipeline to execute where each row represents a stage as a JSON string. Eg. `[ { \"$match\": { \"categories\": \"Bakery\" } }, { \"$group\": { \"_id\": \"$stars\", \"count\": { \"$sum\": 1 } } } ]`", }, }, methods: { async excecuteAggregation({ database, collectionName, pipeline, } = {}) { const { app } = this; const client = await app.getClient(); const collection = app.getCollection(client, database, collectionName); const cursor = collection.aggregate(pipeline); const result = await utils.iterate(cursor); await client.close(); return result; }, }, async run({ $ }) { const { excecuteAggregation, database, collectionName, pipeline, } = this; const response = await excecuteAggregation({ database, collectionName, pipeline: utils.parseArray(pipeline), }); $.export("$summary", `Successfully executed aggregation pipeline on collection with \`${response.length}\` document(s).`); return response; }, }; 

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
MongoDBappappThis component uses the MongoDB app.
DatabasedatabasestringSelect a value from the drop down menu.
CollectioncollectionNamestringSelect a value from the drop down menu.
Pipelinepipelinestring[]

The aggregation pipeline to execute where each row represents a stage as a JSON string. Eg. [ { "$match": { "categories": "Bakery" } }, { "$group": { "_id": "$stars", "count": { "$sum": 1 } } } ]

Authentication

MongoDB uses API keys for authentication. When you connect your MongoDB account, Pipedream securely stores the keys so you can easily authenticate to MongoDB APIs in both code and no-code steps.

Before you connect to your Mongo database from Pipedream, please make sure your database is accessible from the public internet. You may need to add a firewall rule allowing connections from 0.0.0.0/0.

Then, enter the details of your Mongo host / database below.

About MongoDB

MongoDB is an open source NoSQL database management program.

More Ways to Use MongoDB

Triggers

New Collection from the MongoDB API

Emit new an event when a new collection is added to a database

 
Try it
New Database from the MongoDB API

Emit new an event when a new database is added

 
Try it
New Document from the MongoDB API

Emit new an event when a new document is added to a collection

 
Try it
New Field in Document from the MongoDB API

Emit new an event when a new field is added to a document

 
Try it

Actions

Create New Document with the MongoDB API

Create a new document in a collection of your choice. See the docs here

 
Try it
Delete a Document with the MongoDB API

Delete a single document by ID. See the docs here

 
Try it
Find Document with the MongoDB API

Finds a document by a query filter. See the documentation

 
Try it
Find Document by Id with the MongoDB API

Retrieves a single document by ID. See the docs here

 
Try it
Search Documents with the MongoDB API

Search for specific documents or return all documents. See the docs here

 
Try it
Update a Document with the MongoDB API

Updates a single document by ID. See the docs here

 
Try it
Update Documents with the MongoDB API

Updates many documents by query filter. See the documentation

 
Try it

Explore Other Apps

1
-
24
of
2,800+
apps by most popular

Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Anthropic (Claude)
Anthropic (Claude)
AI research and products that put safety at the frontier. Introducing Claude, a next-generation AI assistant for your tasks, no matter the scale.
Google Sheets
Google Sheets
Use Google Sheets to create and edit online spreadsheets. Get insights together with secure sharing in real-time and from any device.
Telegram
Telegram
Telegram, is a cloud-based, cross-platform, encrypted instant messaging (IM) service.
Google Drive
Google Drive
Google Drive is a file storage and synchronization service which allows you to create and share your work online, and access your documents from anywhere.
HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Google Calendar
Google Calendar
With Google Calendar, you can quickly schedule meetings and events and get reminders about upcoming activities, so you always know what’s next.
Schedule
Schedule
Trigger workflows on an interval or cron schedule.
Pipedream Utils
Pipedream Utils
Utility functions to use within your Pipedream workflows
Shopify
Shopify
Shopify is a complete commerce platform that lets anyone start, manage, and grow a business. You can use Shopify to build an online store, manage sales, market to customers, and accept payments in digital and physical locations.
Supabase
Supabase
Supabase is an open source Firebase alternative.
MySQL
MySQL
MySQL is an open-source relational database management system.
PostgreSQL
PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
Premium
AWS
AWS
Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing services.
Premium
Twilio SendGrid
Twilio SendGrid
Send marketing and transactional email through the Twilio SendGrid platform with the Email API, proprietary mail transfer agent, and infrastructure for scalable delivery.
Amazon SES
Amazon SES
Amazon SES is a cloud-based email service provider that can integrate into any application for high volume email automation
Premium
Klaviyo
Klaviyo
Email Marketing and SMS Marketing Platform
Premium
Zendesk
Zendesk
Zendesk is award-winning customer service software trusted by 200K+ customers. Make customers happy via text, mobile, phone, email, live chat, social media.
Premium
ServiceNow
ServiceNow
The smarter way to workflow
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Microsoft Teams
Microsoft Teams
Microsoft Teams has communities, events, chats, channels, meetings, storage, tasks, and calendars in one place.