mongodb

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

MongoDB

Extract collection metadata from a MongoDB server.

Usage

source:
  name: mongodb
  config:
    connection_url: mongodb://admin:pass123@localhost:27017
    exclude:
      databases:
        - database_a
        - database_b
      collections:
        - database_c.collection_a

Configuration

Key Type Required Description
connection_url string Yes MongoDB connection URI.
exclude.databases []string No List of database names to exclude.
exclude.collections []string No List of collections to exclude, in database.collection format. Default system collections are always excluded.

Entities

  • Entity type: table
  • URN format: urn:mongodb:{scope}:collection:{database}.{collection}
Property Type Description
properties.profile.total_rows int Estimated document count (omitted if zero).

Edges

This extractor does not emit edges.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConnectionURL string  `json:"connection_url" yaml:"connection_url" mapstructure:"connection_url" validate:"required"`
	Exclude       Exclude `json:"exclude" yaml:"exclude" mapstructure:"exclude"`
}

Config holds the connection URL for the extractor

type Exclude

type Exclude struct {
	Databases   []string `json:"databases" yaml:"databases" mapstructure:"databases"`
	Collections []string `json:"collections" yaml:"collections" mapstructure:"collections"`
}

type Extractor

type Extractor struct {
	plugins.BaseExtractor
	// contains filtered or unexported fields
}

Extractor manages the communication with the mongo server

func New

func New(logger log.Logger) *Extractor

New returns a pointer to an initialized Extractor Object

func (*Extractor) Extract

func (e *Extractor) Extract(ctx context.Context, emit plugins.Emit) (err error)

Extract collects metadata of each database through emitter

func (*Extractor) Init

func (e *Extractor) Init(ctx context.Context, config plugins.Config) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL