Skip to content

MongoDB 数据转发 ​

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.

【配图占位:设备数据写入 MongoDB 的数据流图】

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

【配图占位:MongoDB 转发配置弹窗截图】

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
{
  "project_id": "proj-xyz",
  "timestamp": 1709856000,
  "points": [
    {
      "point_id": "POINT_ID_FROM_PLATFORM",
      "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.