{
  "format": "datay-etl-task",
  "version": "1.0",
  "task": {
    "taskName": "MongoDB CDC 实时同步到 DuckDB",
    "taskCode": "tmpl_mongo_cdc_to_duckdb",
    "taskDesc": "基于 Change Streams 捕获 MongoDB 集合变更并写入 DuckDB。前置要求：MongoDB 必须运行在副本集或分片集群上。",
    "dir": "/集成模板",
    "type": "ETL",
    "cron": "",
    "retryCount": 0,
    "timeoutSeconds": 0,
    "priority": 2,
    "project": "template",
    "nodes": [
      {
        "label": "采集 MongoDB 变更",
        "code": "n1",
        "desc": "通过 Change Streams 采集 demo.orders 的增量变更",
        "type": "MongoCDCInput",
        "config": {
          "sourceId": "tmpl-mongo-source",
          "schema": "demo",
          "collection": "orders",
          "fullDocument": "updateLookup",
          "maxAwaitTimeMs": 1000,
          "snapshot": true,
          "snapshotFetchSize": 10000,
          "ignoreError": true,
          "reconnectMaxAttempts": 5,
          "reconnectIntervalMs": 3000
        },
        "xAxis": "120",
        "yAxis": "160",
        "status": "0"
      },
      {
        "label": "写入 DuckDB 数仓",
        "code": "n2",
        "desc": "写入模板-DuckDB数仓 main 下与上游同名的表，模式 auto",
        "type": "StreamJdbcOutput",
        "config": {
          "sourceId": "tmpl-duckdb-dw",
          "schema": "main",
          "table": "",
          "model": "auto"
        },
        "xAxis": "560",
        "yAxis": "160",
        "status": "0"
      }
    ],
    "edges": [
      {
        "name": "",
        "code": "e1",
        "source": "n1",
        "target": "n2",
        "config": null,
        "status": "0"
      }
    ]
  },
  "references": {
    "dataSources": [
      {
        "oldId": "tmpl-mongo-source",
        "name": "模板-MongoDB源库",
        "type": "MONGODB",
        "url": "mongodb://127.0.0.1:27017"
      },
      {
        "oldId": "tmpl-duckdb-dw",
        "name": "模板-DuckDB数仓",
        "type": "DUCKDB",
        "url": "jdbc:duckdb:./data/template_dw.duckdb"
      }
    ],
    "models": []
  }
}
