Skip to content

MongoDB Forwarding

Store device data directly in your MongoDB database. MongoDB forwarding is perfect for building custom analytics, dashboards, and applications with flexible document storage.

Overview

Device data is automatically stored as documents in your specified MongoDB collection, ready for querying and analysis.

Quick Start

Step 1: Prepare Your MongoDB

  1. Create a MongoDB database (MongoDB Atlas recommended)
  2. Create a collection for device data
  3. Get your connection string

Step 2: Create a Forwarding Profile

  1. Go to Org → Data Forwarding
  2. Click + New Profile
  3. Select MongoDB as the type
  4. Enter your MongoDB URI and collection name
  5. Click Save

Configuration Options

OptionRequiredDescription
MongoDB URIYesYour database connection string
CollectionYesTarget collection name
NameNoA friendly name for this profile
PriorityNoExecution order (higher = earlier)

Data Format

Each device reading is stored as a document:

json
{
  "device_id": "d-1000-abc",
  "project_id": "proj-xyz",
  "timestamp": 1709856000,
  "factors": [
    {
      "agri_id": "d-1000-abc-1-00",
      "value": 25.5,
      "unit": "°C"
    }
  ]
}

Security Tips

  • Use a dedicated database user with write-only permissions
  • Enable SSL/TLS encryption
  • Add YenGear IoT Cloud IPs to your whitelist if using IP restrictions

Troubleshooting

ProblemSolution
Connection failedVerify your connection string is correct
Authentication errorCheck username and password
Write failedEnsure the user has write permissions
TimeoutCheck firewall settings and IP whitelist

Use Cases

  • Historical Analysis: Query past device readings
  • Custom Dashboards: Build visualizations with MongoDB aggregations
  • Application Integration: Use data in your MongoDB-based apps

Need Help?

Contact us at [email protected] for technical support.