Skip to content

MongoDB

MongoDB

Manage mongodb database, collections and documents

Description

MongoDB integration gives you ability to manage your mongoDB database, create collections, create/update/read documents.

Installation

For integrating with mongodb, you need to provide your mongodb URI, credentials, auth mechanism and authorization token. Make sure that service_name is set as mongodb and there is one cluster named elastic-default since this will be used by default if no cluster is specified in the command. Supported auth mechanisms are SCRAM-SHA-256,SCRAM-SHA-1, MONGODB-CR, MongoDB-AWS, MONGODB-X509. To use default value, leave it blank. See mongodb auth mechanisms for details.

Helm Config

Below is sample configuration for enabling mongodb integration through Helm Chart Values file

mongodb:
  disabled: false
  database: default
  uri: "mongodb://localhost:27017"
  username:
  password:
  auth_mechanism: <"MONGODB-AWS" or "MONGODB-X509" or "">
  tls_config:
    tls_ca_file: ./certs/dev/CA.crt
    tls_certificate_key_file: ./certs/dev/localhost.key
  aws_config:
    access_key_id:
    access_key_secret:
    session_token:
  • disabled tag can be set to true to temporarily disable the service without removing the config
  • tags "tls_config" and "aws_config" are optional

Direct Config

Below is sample configuration for enabling kafka integration

modules:
  - name: maira_io.module.mongodb
services:
  - name: maira_io.service.mongodb
    typed_config:
      "@type": types.google.com/maira_io.config.service.mongodb.v1.Config
      cluster:
        database: admin
        uri: "mongodb://localhost:27017"
        username:
        password:
        auth_mechanism:
        tls_config:
          tls_ca_file: ./certs/dev/CA.crt
          tls_certificate_key_file: ./certs/dev/localhost.key
        aws_config:
          access_key_id:
          access_key_secret:
          session_token: