@netpad-io/netpad-nodes-mongodb
v1.0.0
Published
MongoDB integration nodes for NetPad - Query, Insert, Update, Delete operations
Downloads
6
Maintainers
Readme
netpad-nodes-mongodb
MongoDB integration nodes for NetPad workflow automation. This community package provides nodes for all common MongoDB operations.
Installation
npm install netpad-nodes-mongodbNodes Included
1. MongoDB Query
Query documents from a MongoDB collection with support for:
- Find operations with filters
- Projection (field selection)
- Sorting
- Limiting results
- Skip for pagination
2. MongoDB Insert
Insert documents into MongoDB collections:
- Single document insert
- Bulk insert multiple documents
- Automatic ID generation
- Return inserted IDs
3. MongoDB Update
Update existing documents:
- Update single or multiple documents
- Support for update operators ($set, $push, etc.)
- Upsert capability
- Return modified count
4. MongoDB Delete
Delete documents from collections:
- Delete single or multiple documents
- Filter-based deletion
- Return deleted count
5. MongoDB Aggregate
Run aggregation pipelines:
- Support for all aggregation stages
- Complex data transformations
- Group operations
- Lookup (join) operations
Configuration
All nodes require MongoDB credentials to be configured in NetPad:
- Go to Credentials in NetPad
- Create new MongoDB credentials
- Enter your connection details:
- Connection String (e.g.,
mongodb://localhost:27017) - Database Name
- Authentication details if required
- Connection String (e.g.,
Usage Examples
Query Example
// Input configuration for MongoDB Query node
{
"collection": "users",
"filter": { "age": { "$gte": 18 } },
"projection": { "name": 1, "email": 1 },
"sort": { "createdAt": -1 },
"limit": 10
}Insert Example
// Input for MongoDB Insert node
{
"collection": "products",
"documents": [
{
"name": "Widget",
"price": 19.99,
"category": "tools"
}
]
}Update Example
// Input for MongoDB Update node
{
"collection": "orders",
"filter": { "status": "pending" },
"update": {
"$set": { "status": "processing" },
"$currentDate": { "lastModified": true }
}
}Development
To contribute to this package:
- Clone the repository
- Install dependencies:
npm install - Make your changes in the
srcdirectory - Build:
npm run build - Test locally:
npm link - Submit a pull request
License
MIT © NetPad Community
Support
- Report issues: GitHub Issues
- Documentation: NetPad Docs
- Community: NetPad Discord
