> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.mongodb.db.NewDocument

- Component: `appmixer.mongodb.db.NewDocument`
- Kind: Trigger
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.mongodb 1.4.1](https://connectors.appmixer.com/connector/appmixer.mongodb/1.4.1.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.mongodb/1.4.1/component/appmixer.mongodb.db.NewDocument>

Trigger when a new document has been added to a MongoDB collection.

## Properties

| Field | Type | Description |
| --- | --- | --- |
| Storage (`storeId`) | select | Select a data store. The data store will be used to store data streamed from MongoDB so that we can compare them later to detect new rows. If you do not select a data store, one will be automatically created for you when the flow starts and deleted when the flow stops. If you do select a data store manually, you are responsible for clearing/deleting it when you don't need it anymore (note that the data in the data store is populated automatically, so any data left in the store affects the next flow run). |
| Collection (`collection`) | text | Enter your collection name. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Document (`document`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.mongodb.db.NewDocument",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "Trigger when a new document has been added to a MongoDB collection.",
  "private": false,
  "tick": true,
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:mongodb"
  },
  "state": {
    "persistent": true
  },
  "properties": {
    "schema": {
      "type": "object",
      "properties": {
        "storeId": {
          "type": "string"
        },
        "collection": {
          "type": "string"
        }
      },
      "required": [
        "collection"
      ]
    },
    "inspector": {
      "inputs": {
        "storeId": {
          "type": "select",
          "label": "Storage",
          "index": 1,
          "source": {
            "url": "/component/appmixer/utils/storage/ListStores?outPort=out",
            "data": {
              "transform": "./ListStores#toSelectArray"
            }
          },
          "tooltip": "Select a data store. The data store will be used to store data streamed from MongoDB so that we can compare them later to detect new rows. If you do not select a data store, one will be automatically created for you when the flow starts and deleted when the flow stops. If you do select a data store manually, you are responsible for clearing/deleting it when you don't need it anymore (note that the data in the data store is populated automatically, so any data left in the store affects the next flow run)."
        },
        "collection": {
          "type": "text",
          "index": 1,
          "label": "Collection",
          "tooltip": "Enter your collection name."
        }
      }
    }
  },
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Document",
          "value": "document",
          "schema": {
            "type": "object",
            "example": {
              "_id": "64a7f2c9e4b0d1a2b3c4d5e6",
              "name": "John Doe",
              "email": "john@example.com"
            }
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
