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

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

Run an arbitrary query against your MongoDB database.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Collection (`collection`) | text | Enter your collection name. |
| Operation (`operation`) | select | Select an operation. |
| Query (`query`) | textarea | Enter a JSON query. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Documents (`documents`) | array | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.mongodb.db.Query",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "Run an arbitrary query against your MongoDB database.",
  "private": false,
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:mongodb"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "query": {
            "type": "string"
          }
        },
        "required": [
          "collection",
          "operation",
          "query"
        ]
      },
      "inspector": {
        "inputs": {
          "collection": {
            "type": "text",
            "index": 1,
            "label": "Collection",
            "tooltip": "Enter your collection name."
          },
          "operation": {
            "type": "select",
            "options": [
              {
                "content": "find",
                "value": "find"
              },
              {
                "content": "findOne",
                "value": "findOne"
              },
              {
                "content": "aggregate",
                "value": "aggregate"
              }
            ],
            "index": 2,
            "label": "Operation",
            "tooltip": "Select an operation."
          },
          "query": {
            "type": "textarea",
            "index": 3,
            "label": "Query",
            "tooltip": "Enter a JSON query."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Documents",
          "value": "documents",
          "schema": {
            "type": "array",
            "example": [
              {
                "_id": "64a7f2c9e4b0d1a2b3c4d5e6",
                "name": "John Doe",
                "email": "john@example.com"
              }
            ]
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
