MongoDB is an open source NoSQL database management program.
Create a new document in a collection of your choice. See the docs here
Sends a new Push notification to the user. See the documentation
Execute an aggregation pipeline on a MongoDB collection. See the documentation
The MongoDB API provides powerful capabilities to interact with a MongoDB database, allowing you to perform CRUD (Create, Read, Update, Delete) operations, manage databases, and execute sophisticated queries. With Pipedream, you can harness these abilities to automate tasks, sync data across various apps, and react to events in real-time. It’s a combo that’s particularly potent for managing data workflows, syncing application states, or triggering actions based on changes to your data.
import mongodb from 'mongodb'
export default defineComponent({
props: {
mongodb: {
type: "app",
app: "mongodb",
},
collection: {
type: "string"
},
filter: {
type: "object"
}
},
async run({steps, $}) {
const MongoClient = mongodb.MongoClient
const {
database,
hostname,
username,
password,
} = this.mongodb.$auth
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)
const results = await db.collection(this.collection).find(this.filter).toArray();
$.export('results', results);
await client.close()
},
})
The Push by Techulus API offers a straightforward way to send notifications directly to your devices. With this functionality within Pipedream, you can craft workflows that alert you or someone else when certain events happen in your apps or in your code. Think of it as wiring a custom doorbell for the digital events that matter to you. Whether you're tracking sales on your e-commerce platform, monitoring website uptime, or just want to get pinged when your long-running script finishes, Push by Techulus nudges you in real time.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
push_by_techulus: {
type: "app",
app: "push_by_techulus",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://push.techulus.com/api/v1/notify/${this.push_by_techulus.$auth.api_key}`,
headers: {
"x-api-key": `${this.push_by_techulus.$auth.api_key}`,
"Content-Type": `application/json`,
},
params: {
title: `Welcome to Push by Techulus`,
body: `This is your first notification`,
},
})
},
})