rpmongo

package
v0.0.0-...-131c832 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongoFetch

func MongoFetch(ctxDatabaseName string, collectionName string, projection map[string]any) *Stage

func MongoFindOne

func MongoFindOne(ctxDatabaseName string, collectionName string, opts ...MongoFindOneOptions) *Stage

func MongoInsert

func MongoInsert(ctxDatabaseName string, collectionName string) *Stage

MongoInsert inserts in as a document

func MongoPipe

func MongoPipe(ctxDatabaseName string, collectionName string, opts *MongoPipeOptions) *Stage

MongoPipe executes the given pipeline of the in parameter on the given collection. The *mongo.Database instance must be set in the context with the given ctxDatabaseName as the key. in must be a valid pipeline for the mongo.Collection.Aggregate() method.

Types

type MongoFindOneOptions

type MongoFindOneOptions struct {
	// If non-nil, the result will be unmarshalled into this object. Default is nil.
	// If nil, the result will be unmarshalled into an object of type map[string]any.
	// It is sent to the mongo.SingleResult.Decode() method.
	Result any
}

type MongoPipeOptions

type MongoPipeOptions struct {
	// If non-nil, the results will be unmarshalled into this object. Default is nil.
	// It must be a pointer to a slice. It is sent to the mongo.Cursor.All() method.
	Results any
}

Jump to

Keyboard shortcuts

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