MongoDB is an open source NoSQL database management program.
Create a new document in a collection of your choice. See the docs here
Extract structured data from a document. See the documentation
Extract structured data from unstructured text. 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 Reform API allows you to automate the management and analysis of forms and surveys. By connecting Reform to Pipedream, you can create, update, and retrieve form submissions, and set up workflows that trigger on new responses. This opens up possibilities for integrating form data with other tools, managing event-driven notifications, or feeding customer insights into your CRM systems—all in a serverless environment that scales with your needs.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
reform: {
type: "app",
app: "reform",
}
},
async run({steps, $}) {
const fields_to_extract = [
{
"name": "Nouns",
"description": "Please extract all nouns.",
"type": "String"
},
{
"name": "Verbs",
"description": "Please extract all verbs.",
"type": "String"
}
]
const data = {
text_content: "There are usually about 200 words in a paragraph, but this can vary widely. Most paragraphs focus on a single idea that's expressed with an introductory sentence, then followed by two or more supporting sentences about the idea. A short paragraph may not reach even 50 words while long paragraphs can be over 400 words long, but generally speaking they tend to be approximately 200 words in length.",
fields_to_extract: fields_to_extract
}
return await axios($, {
method: "post",
url: `https://api.reformhq.com/v1/api/extract-text `,
headers: {
Authorization: `Bearer ${this.reform.$auth.api_key}`,
"Content-Type": `application/json`,
},
data,
})
},
})