Documentation
¶
Index ¶
- func MongoFetch(ctxDatabaseName string, collectionName string, projection map[string]any) *Stage
- func MongoFindOne(ctxDatabaseName string, collectionName string, opts ...MongoFindOneOptions) *Stage
- func MongoInsert(ctxDatabaseName string, collectionName string) *Stage
- func MongoPipe(ctxDatabaseName string, collectionName string, opts *MongoPipeOptions) *Stage
- type MongoFindOneOptions
- type MongoPipeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MongoFetch ¶
func MongoFindOne ¶
func MongoFindOne(ctxDatabaseName string, collectionName string, opts ...MongoFindOneOptions) *Stage
func MongoInsert ¶
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 }
Click to show internal directories.
Click to hide internal directories.