{
  "jsonSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "MongoDB collector configuration.",
    "type": "object",
    "properties": {
      "update_every": {
        "title": "Update every",
        "description": "Data collection interval, measured in seconds.",
        "type": "integer",
        "minimum": 1,
        "default": 1
      },
      "uri": {
        "title": "URI",
        "description": "The MongoDB connection string in the [standard connection string format](https://www.mongodb.com/docs/manual/reference/connection-string/#std-label-connections-standard-connection-string-format).",
        "type": "string",
        "default": "mongodb://localhost:27017"
      },
      "timeout": {
        "title": "Timeout",
        "description": "Timeout for queries, in seconds.",
        "type": "number",
        "minimum": 0.5,
        "default": 1
      },
      "databases": {
        "title": "Database selector",
        "description": "Configuration for monitoring specific databases. If left empty, no [database stats](https://docs.mongodb.com/manual/reference/command/dbStats/) will be collected.",
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "includes": {
            "title": "Include",
            "description": "Include databases that match any of the specified include [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).",
            "type": [
              "array",
              "null"
            ],
            "items": {
              "title": "Pattern",
              "type": "string"
            },
            "uniqueItems": true
          },
          "excludes": {
            "title": "Exclude",
            "description": "Exclude databases that match any of the specified exclude [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).",
            "type": [
              "array",
              "null"
            ],
            "items": {
              "title": "Pattern",
              "type": "string"
            },
            "uniqueItems": true
          }
        }
      },
      "vnode": {
        "title": "Vnode",
        "description": "Associates this data collection job with a [Virtual Node](https://learn.netdata.cloud/docs/netdata-agent/configuration/organize-systems-metrics-and-alerts#virtual-nodes).",
        "type": "string"
      }
    },
    "required": [
      "uri"
    ],
    "patternProperties": {
      "^name$": {}
    }
  },
  "uiSchema": {
    "uiOptions": {
      "fullPage": true
    },
    "vnode": {
      "ui:placeholder": "To use this option, first create a Virtual Node and then reference its name here."
    },
    "uri": {
      "ui:placeholder": "mongodb://username:password@host:port"
    },
    "timeout": {
      "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)."
    },
    "databases": {
      "ui:help": "The logic for inclusion and exclusion is as follows: `(include1 OR include2) AND !(exclude1 OR exclude2)`."
    },
    "ui:flavour": "tabs",
    "ui:options": {
      "tabs": [
        {
          "title": "Base",
          "fields": [
            "update_every",
            "uri",
            "timeout",
            "vnode"
          ]
        },
        {
          "title": "Database stats",
          "fields": [
            "databases"
          ]
        }
      ]
    }
  }
}
