> 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.CreateDocument

- Component: `appmixer.mongodb.db.CreateDocument`
- Kind: Action
- 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.CreateDocument>

Create a new document in a MongoDB collection.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Collection (`collection`) | text | Enter your collection name. |
| Query (`document`) | textarea | Enter a JSON query. |

## Output ports

### Port `out`

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

## Full metadata (component.json)

```json
{
  "name": "appmixer.mongodb.db.CreateDocument",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "Create a new document in a MongoDB collection.",
  "private": false,
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:mongodb"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string"
          },
          "document": {
            "type": "string"
          }
        },
        "required": [
          "collection",
          "document"
        ]
      },
      "inspector": {
        "inputs": {
          "collection": {
            "type": "text",
            "index": 1,
            "label": "Collection",
            "tooltip": "Enter your collection name."
          },
          "document": {
            "type": "textarea",
            "index": 3,
            "label": "Query",
            "tooltip": "Enter a JSON query."
          }
        }
      }
    }
  ],
  "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)"
}
```
