github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/inputs/mongodb.md (about)

     1  ---
     2  title: mongodb
     3  type: input
     4  status: experimental
     5  categories: ["Services"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/input/mongodb.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  :::caution EXPERIMENTAL
    19  This component is experimental and therefore subject to change or removal outside of major version releases.
    20  :::
    21  Executes a find query and creates a message for each row received.
    22  
    23  Introduced in version 3.64.0.
    24  
    25  ```yaml
    26  # Config fields, showing default values
    27  input:
    28    label: ""
    29    mongodb:
    30      url: ""
    31      database: ""
    32      collection: ""
    33      username: ""
    34      password: ""
    35      query: ""
    36  ```
    37  
    38  Once the rows from the query are exhausted this input shuts down, allowing the pipeline to gracefully terminate (or the next input in a [sequence](/docs/components/inputs/sequence) to execute).
    39  
    40  ## Fields
    41  
    42  ### `url`
    43  
    44  The URL of the target MongoDB DB.
    45  
    46  
    47  Type: `string`  
    48  
    49  ```yaml
    50  # Examples
    51  
    52  url: mongodb://localhost:27017
    53  ```
    54  
    55  ### `database`
    56  
    57  The name of the target MongoDB database.
    58  
    59  
    60  Type: `string`  
    61  
    62  ### `collection`
    63  
    64  The collection to select from.
    65  
    66  
    67  Type: `string`  
    68  
    69  ### `username`
    70  
    71  The username to connect to the database.
    72  
    73  
    74  Type: `string`  
    75  Default: `""`  
    76  
    77  ### `password`
    78  
    79  The password to connect to the database.
    80  
    81  
    82  Type: `string`  
    83  Default: `""`  
    84  
    85  ### `query`
    86  
    87  Bloblang expression describing MongoDB query.
    88  
    89  
    90  Type: `string`  
    91  
    92  ```yaml
    93  # Examples
    94  
    95  query: |2
    96          root.from = {"$lte": timestamp_unix()}
    97          root.to = {"$gte": timestamp_unix()}
    98  ```
    99  
   100