mongodb

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SourceType string = "mongodb"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name string `yaml:"name" validate:"required"`
	Type string `yaml:"type" validate:"required"`
	Uri  string `yaml:"uri" validate:"required"` // MongoDB Atlas connection URI
}

func (Config) Initialize

func (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error)

func (Config) SourceConfigType

func (r Config) SourceConfigType() string

type Source

type Source struct {
	Config
	Client *mongo.Client
}

func (*Source) Aggregate

func (s *Source) Aggregate(ctx context.Context, pipelineString string, canonical, readOnly bool, database, collection string) ([]any, error)

func (*Source) DeleteMany

func (s *Source) DeleteMany(ctx context.Context, filterString, database, collection string) (any, error)

func (*Source) DeleteOne

func (s *Source) DeleteOne(ctx context.Context, filterString, database, collection string) (any, error)

func (*Source) Find

func (s *Source) Find(ctx context.Context, filterString, database, collection string, opts *options.FindOptionsBuilder) ([]any, error)

func (*Source) FindOne

func (s *Source) FindOne(ctx context.Context, filterString, database, collection string, opts *options.FindOneOptionsBuilder) ([]any, error)

func (*Source) InsertMany

func (s *Source) InsertMany(ctx context.Context, jsonData string, canonical bool, database, collection string) ([]any, error)

func (*Source) InsertOne

func (s *Source) InsertOne(ctx context.Context, jsonData string, canonical bool, database, collection string) (any, error)

func (*Source) MongoClient

func (s *Source) MongoClient() *mongo.Client

func (*Source) SourceType

func (s *Source) SourceType() string

func (*Source) ToConfig

func (s *Source) ToConfig() sources.SourceConfig

func (*Source) UpdateMany

func (s *Source) UpdateMany(ctx context.Context, filterString string, canonical bool, updateString, database, collection string, upsert bool) ([]any, error)

func (*Source) UpdateOne

func (s *Source) UpdateOne(ctx context.Context, filterString string, canonical bool, updateString, database, collection string, upsert bool) (any, error)

Jump to

Keyboard shortcuts

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