MongoDB

The global cloud database service for modern applications

Go to site
Explore
/
Apps
/
MongoDB

MongoDB API Integrations

Build and run workflows using the MongoDB API. Use 1000s of open source triggers and actions across 500+ apps. Or write custom code to integrate any app or API in seconds.

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()

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.

Please enter the details of your specific Mongo host / database below.