MongoDB Document Storage Now Available
ApudFlow now supports MongoDB for document storage with built-in user isolation. Whether you're building user profiles, storing analytics data, or managing content, MongoDB workers provide flexible document storage with automatic security.
What is MongoDB?
MongoDB is a document database that stores data in flexible, JSON-like documents. Unlike traditional relational databases, MongoDB allows you to store complex, nested data structures without predefined schemas.
Key Features
Automatic User Isolation
Every document is automatically tagged with your user ID, ensuring complete data separation between users. No cross-tenant data leaks or security concerns.
Two Connection Modes
- Internal Mode: Managed connection with a single built-in collection. No setup required - start storing data instantly.
- External Mode: Connect to your own MongoDB database and collections for full control.
Rich Query Capabilities
Perform complex queries using MongoDB's powerful query language. Filter by any field, use regex patterns, and aggregate data across documents.
What Can You Use It For?
User Data Management
Store user profiles, preferences, and settings. Perfect for applications that need to maintain user-specific data across sessions.
Example: Store user trading preferences
- operation: insert
- document: {"theme": "dark", "defaultTimeframe": "1H", "alertsEnabled": true}
Example: User notification settings
- operation: insert
- document: {
"emailNotifications": true,
"smsAlerts": false,
"notificationTypes": ["price_alerts", "news", "portfolio_updates"],
"quietHours": {"start": "22:00", "end": "08:00"}
}
Analytics and Metrics
Collect and analyze usage data, performance metrics, or business intelligence data. MongoDB's flexible schema makes it easy to evolve your data structure as needs change.
Example: Track user interactions
- operation: insert
- document: {"action": "chart_view", "symbol": "AAPL", "timestamp": "2025-10-21T10:00:00Z"}
Example: Performance analytics
- operation: insert
- document: {
"workflowId": "market_scanner",
"executionTime": 2.3,
"dataPoints": 15420,
"success": true,
"timestamp": "2025-10-21T10:00:00Z"
}
Example: A/B test results
- operation: insert
- document: {
"testId": "new_ui_layout",
"variant": "A",
"userId": "user123",
"conversion": true,
"timeSpent": 45
}
Content Management
Store articles, blog posts, comments, or any structured content. The document model is perfect for content with varying fields and nested data.
Example: Save analysis reports
- operation: insert
- document: {
"title": "Q4 Earnings Analysis",
"content": "...",
"tags": ["earnings", "analysis"],
"metadata": {"wordCount": 1250, "readTime": 6}
}
Example: Product catalog
- operation: insert
- document: {
"name": "Premium Analytics Package",
"description": "Advanced market analysis tools",
"pricing": {"monthly": 49.99, "yearly": 499.99},
"features": ["real-time data", "custom indicators", "alerts"],
"category": "analytics"
}
Workflow State Persistence
Save intermediate workflow results, cache expensive computations, or maintain state between workflow runs.
Example: Cache API responses
- operation: insert
- document: {"endpoint": "/api/market-data", "response": {...}, "cachedAt": "2025-10-21T10:00:00Z"}
Example: Workflow checkpoints
- operation: insert
- document: {
"workflowId": "data_import_001",
"step": "data_validation",
"progress": 75,
"lastProcessedId": 15420,
"errors": []
}
E-commerce Applications
Manage product inventories, customer orders, and shopping cart data with complex nested structures.
Example: Order management
- operation: insert
- document: {
"orderId": "ORD-2025-001",
"customerId": "user123",
"items": [
{"productId": "AAPL", "quantity": 100, "price": 150.25},
{"productId": "GOOGL", "quantity": 50, "price": 2800.00}
],
"total": 140125.00,
"status": "pending"
}
IoT and Sensor Data
Store time-series data from sensors, devices, or monitoring systems with flexible schemas.
Example: Sensor readings
- operation: insert
- document: {
"deviceId": "sensor_001",
"timestamp": "2025-10-21T10:00:00Z",
"readings": {
"temperature": 23.5,
"humidity": 65.2,
"pressure": 1013.25
},
"location": {"lat": 40.7128, "lng": -74.0060}
}
Gaming and User Progress
Track player statistics, achievements, inventory, and game state with nested data structures.
Example: Player profile
- operation: insert
- document: {
"playerId": "player123",
"level": 25,
"experience": 15420,
"inventory": [
{"item": "golden_pickaxe", "quantity": 1},
{"item": "diamond_ore", "quantity": 50}
],
"achievements": ["first_trade", "profit_master", "speed_trader"]
}
Financial Markets & Trading
Store complex financial data, trading strategies, market analysis, and portfolio management information with flexible document structures.
Example: Trading strategy configuration
- operation: insert
- document: {
"strategyName": "Momentum Crossover",
"parameters": {
"fastPeriod": 9,
"slowPeriod": 21,
"stopLoss": 0.02,
"takeProfit": 0.05
},
"symbols": ["AAPL", "MSFT", "GOOGL"],
"active": true,
"performance": {"winRate": 0.68, "avgReturn": 0.034}
}
Example: Portfolio holdings
- operation: insert
- document: {
"portfolioId": "growth_portfolio",
"holdings": [
{"symbol": "AAPL", "shares": 150, "avgPrice": 145.20, "currentValue": 22530.00},
{"symbol": "MSFT", "shares": 75, "avgPrice": 280.50, "currentValue": 21037.50}
],
"totalValue": 43567.50,
"lastUpdated": "2025-10-21T10:00:00Z"
}
Example: Market analysis reports
- operation: insert
- document: {
"symbol": "AAPL",
"analysisType": "technical",
"indicators": {
"rsi": 65.4,
"macd": {"signal": 2.15, "histogram": 0.85},
"movingAverages": {"sma20": 152.30, "sma50": 148.75}
},
"recommendation": "BUY",
"confidence": 0.82,
"generatedAt": "2025-10-21T10:00:00Z"
}
Example: Trade execution log
- operation: insert
- document: {
"tradeId": "T20251021001",
"symbol": "AAPL",
"side": "BUY",
"quantity": 100,
"price": 150.25,
"timestamp": "2025-10-21T10:00:00Z",
"strategy": "momentum_crossover",
"fees": 1.50,
"executionDetails": {
"venue": "NASDAQ",
"orderType": "MARKET",
"slippage": 0.05
}
}
Example: Risk management data
- operation: insert
- document: {
"riskProfile": "moderate",
"positionLimits": {
"maxSinglePosition": 0.1,
"maxSectorExposure": 0.25,
"maxDrawdown": 0.15
},
"varCalculation": {
"confidence": 0.95,
"timeHorizon": 1,
"value": 12500.00
},
"lastAssessment": "2025-10-21T10:00:00Z"
}
Example: Economic indicators database
- operation: insert
- document: {
"indicator": "GDP_Growth",
"country": "US",
"frequency": "quarterly",
"values": [
{"date": "2025-Q2", "value": 2.1, "forecast": 2.3},
{"date": "2025-Q3", "value": null, "forecast": 2.0}
],
"source": "Bureau of Economic Analysis",
"lastUpdated": "2025-10-21T10:00:00Z"
}
Getting Started
- Add a "MongoDB" worker to your flow
- Choose connection mode (internal for quick start, external for custom setup)
- Select operation (insert, find, update, delete, count)
- Configure your document or query parameters
Example Workflow: User Portfolio Tracker
Create a workflow that:
- Fetches user portfolio data from an API
- Stores it in MongoDB with user isolation
- Updates analytics counters
- Sends notifications based on stored preferences
This combination of document storage with workflow automation opens up endless possibilities for data-driven applications.
Performance & Scalability
MongoDB excels at handling large volumes of data with fast read/write operations. The document model scales naturally as your data structure evolves, making it perfect for growing applications.
Start building with MongoDB today and unlock the power of flexible document storage in your workflows!