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

- Component: `appmixer.mongodb.db.DeleteDocument`
- 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.DeleteDocument>

Delete a document(s) from a MongoDB collection.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Collection (`collection`) | text | Enter your collection name. |
| ID (`id`) | text | Enter the ID of the document to delete. If **ID** is given, then the **Filter** cannot be used. |
| Filter (`filter`) | textarea | Enter the filter used to select the document to delete. If **Filter** is used, then **ID** cannot be specified. |
| One/Many (`quantity`) | select | Update a single document in a collection or update multiple documents in a collection. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Deleted Count (`deletedCount`) | integer | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.mongodb.db.DeleteDocument",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "Delete a document(s) from a MongoDB collection.",
  "private": false,
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:mongodb"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "filter": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          }
        },
        "oneOf": [
          {
            "required": [
              "id"
            ]
          },
          {
            "required": [
              "filter"
            ]
          }
        ],
        "required": [
          "collection"
        ]
      },
      "inspector": {
        "inputs": {
          "collection": {
            "type": "text",
            "index": 1,
            "label": "Collection",
            "tooltip": "Enter your collection name."
          },
          "id": {
            "type": "text",
            "index": 2,
            "label": "ID",
            "tooltip": "Enter the ID of the document to delete. If <b>ID</b> is given, then the <b>Filter</b> cannot be used."
          },
          "filter": {
            "type": "textarea",
            "index": 3,
            "label": "Filter",
            "tooltip": "Enter the filter used to select the document to delete. If </b>Filter</b> is used, then <b>ID</b> cannot be specified."
          },
          "quantity": {
            "type": "select",
            "index": 4,
            "label": "One/Many",
            "tooltip": "Update a single document in a collection or update multiple documents in a collection.",
            "defaultValue": "One",
            "options": [
              {
                "content": "One",
                "value": "One"
              },
              {
                "content": "Many",
                "value": "Many"
              }
            ]
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Deleted Count",
          "value": "deletedCount",
          "schema": {
            "type": "integer",
            "example": 1
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
