examples

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: MIT Imports: 9 Imported by: 0

README

mongo-go-driver Examples

  • TestAggregateArray
  • TestAggregateFilter
  • TestAggregateGraphLookup
  • TestAggregateGroup
  • TestAggregateJSON
  • TestAggregateLookup
  • TestAggregateMatch
  • TestAggregatePipeline
  • TestAggregateRedact
  • TestChangeStreamClient
  • TestChangeStreamCollection
  • TestChangeStreamCollectionWithPipeline
  • TestChangeStreamDatabase
  • TestCount
  • TestDeleteMany
  • TestDeleteOne
  • TestFindMany
  • TestFindManyWithOptions
  • TestFindOne
  • TestFindOneAndReplace
  • TestInsertMany
  • TestInsertOne
  • TestInsertOneWithOptions
  • TestReplaceLoop
  • TestReplaceOne
  • TestRunCommand
  • TestTransactionAbort
  • TestTransactionCommit
  • TestUpdateMany
  • TestUpdateOne

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SeedCarsData

func SeedCarsData(client *mongo.Client, database string) int64

SeedCarsData wraps seedCarsData

Types

type ChangeStream

type ChangeStream struct {
	// contains filtered or unexported fields
}

ChangeStream defines what to watch? client, database or collection

func NewChangeStream

func NewChangeStream() *ChangeStream

NewChangeStream gets a new ChangeStream

func (*ChangeStream) SetCollection

func (cs *ChangeStream) SetCollection(collection string)

SetCollection sets collection

func (*ChangeStream) SetDatabase

func (cs *ChangeStream) SetDatabase(database string)

SetDatabase sets database

func (*ChangeStream) SetPipeline

func (cs *ChangeStream) SetPipeline(pipeline []bson.D)

SetPipeline sets pipeline

func (*ChangeStream) Watch

func (cs *ChangeStream) Watch(client *mongo.Client, cb callback)

Watch prints oplogs in JSON format

Jump to

Keyboard shortcuts

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