Skip to main content

mongodb

Store flexible JSON documents in MongoDB for schema-less data storage.

Overview

The mongodb node stores and retrieves JSON documents from MongoDB. Perfect for IoT data with varying structures, it supports flexible schemas, powerful queries, and horizontal scaling through sharding.

JSON
Native Documents
Schema
Flexible
Atlas
Cloud Support
Aggregation
Pipeline

Properties

Property Type Default Description
uri string "mongodb://localhost" Connection URI
database string "edgeflow" Database name
collection string "data" Collection name
operation string "insert" insert, find, update, delete, aggregate

Operations

insert

{
  "payload": {
    "device": "pi-001",
    "temp": 23.5,
    "timestamp": new Date()
  }
}

find

{
  "payload": {
    "device": "pi-001",
    "temp": { "$gt": 20 }
  }
}

update

{
  "filter": { "device": "pi-001" },
  "update": { "$set": { "status": "active" } }
}

aggregate

{
  "payload": [
    { "$match": { "device": "pi-001" } },
    { "$group": { "_id": "$device", "avg": { "$avg": "$temp" } } }
  ]
}

Related Nodes