Package Information
Available Nodes
Documentation
n8n-nodes-mongodb-query-pro
MongoDB Query nodes for n8n with full ISO date support. Solves the problem of querying MongoDB databases with ISO date formats that the official n8n MongoDB node doesn't handle correctly.
🎯 Problem Solved
The official n8n MongoDB node cannot properly filter dates in ISODATE format. When working with MongoDB databases that store dates in ISO format, queries using $date syntax don't return results.
This package provides nodes that correctly handle MongoDB's date formats:
{
"created_at": {
"$gte": { "$date": "2025-09-11T00:00:00.000Z" },
"$lte": { "$date": "2025-09-11T23:59:59.999Z" }
}
}
📦 Installation
In n8n (Recommended)
- Go to Settings > Community Nodes
- Click Install
- Enter
n8n-nodes-mongodb-query-pro - Click Install
Manual Installation
npm install -g n8n-nodes-mongodb-query-pro
Then restart your n8n instance.
🚀 Features
Exactly Two Nodes Included
This package provides EXACTLY 2 nodes (no more, no less):
MongoDB Query Pro - Regular node for standard n8n workflows
- For building regular workflows
- Direct MongoDB query execution
- Full control over query parameters
MongoDB Query Pro Tool - Automatically generated tool version for AI Agents
- Created automatically by n8n when
usableAsTool: trueis set - For use with n8n AI Agent nodes
- Same functionality, optimized for AI context
- Created automatically by n8n when
⚠️ IMPORTANT: There is only ONE source file (MongoDbQueryPro.node.ts) that generates both nodes. The Tool version is created automatically by n8n, not by a separate file.
Key Features
- ✅ ISO Date Support: Properly handles MongoDB
$datesyntax - ✅ Multiple Operations: Find, FindOne, and Aggregate
- ✅ AI Agent Compatible: Use with n8n AI agents
- ✅ Error Handling: Comprehensive error handling with continue on fail option
- ✅ Flexible Connection: Supports connection string or separate credentials
📊 Supported Operations
Find
Retrieve multiple documents from a collection with optional filtering.
Find One
Retrieve a single document from a collection.
Aggregate
Execute MongoDB aggregation pipelines for complex data operations.
🔍 Query Examples
JSON Query with ISO Dates
{
"created_at": {
"$gte": { "$date": "2024-01-01T00:00:00.000Z" }
},
"status": "active"
}
🔧 Configuration
Credentials
Create MongoDB credentials with:
- Connection String: Full MongoDB connection URI
- Database (Optional): Override database from connection string
Node Parameters
- Collection: MongoDB collection name
- Operation: Find, FindOne, or Aggregate
- Query: MongoDB query in JSON format
- Max Results: Limit number of returned documents
🤖 AI Agent Usage
The MongoDB Query Pro Tool node can be used with n8n AI agents for intelligent database queries. The agent can:
- Generate and execute MongoDB queries
- Process results and provide summaries
- Handle complex aggregation pipelines
🛡️ Security
- No credentials or sensitive data are included in the published package
- All database connections use secure MongoDB drivers
- Connection strings are handled through n8n's credential system
🐛 Known Issues
- Custom nodes may require
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=trueenvironment variable for AI tool usage - Some n8n versions may have restrictions on community node AI tools
📄 License
MIT - See LICENSE file for details
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
🆘 Support
For issues and feature requests, please use the GitHub Issues page.
🏷️ Keywords
n8n, mongodb, mongo, query, database, iso-date, ai-agent, tool, n8n-community-node-package
Made with ❤️ for the n8n community