Pipedream

Integration platform for developers

Go to site

Integrate the Pipedream API with the MongoDB API

Setup the Pipedream API trigger to run a workflow which integrates with the MongoDB API. Pipedream's integration platform allows you to integrate Pipedream and MongoDB remarkably fast. Free for developers.

Query SQL

Run a query against data saved to Pipedream's SQL service. To get started, connect your account using your API key (found in your account settings).

 
Try it
Insert a document into a collection
 
Try it
Get CSV for a SQL query execution

Retrieve a CSV for the results of a specific SQL query execution.

 
Try it

Connect Pipedream

return await require("@pipedreamhq/platform").axios(this, {
  url: `https://api.pipedream.com/v1/users/me`,
  headers: {
    Authorization: `Bearer ${auths.pipedream.api_key}`,
  },
})

Connect MongoDB

const MongoClient = require('mongodb').MongoClient

const {
  database,
  hostname,
  username,
  password,
} = auths.mongodb

const url = `mongodb+srv://${username}:${password}@${hostname}/test?retryWrites=true&w=majority`
const client = await MongoClient.connect(url, { 
  useNewUrlParser: true, 
  useUnifiedTopology: true 
})

const db = client.db(database)
// Enter your target collection as a parameter to this step
this.res = await db.collection(params.collection).insertOne({ name: "Luke Skywalker" })

await client.close()