Versions in this module Expand all Collapse all v1 v1.10.0 Jan 19, 2023 Changes in this version + func ConnectDb(uri string) *mongo.Client + func Copy(cfg *RootConfig, dbc *DBConnector, cmd *cobra.Command) + func CopyHandler(cmd *cobra.Command, args []string) + func DocExistsAndMatch(dst *mongo.Collection, doc bson.D) (bool, bool) + func Execute() + func GenerateConfig(cmd *cobra.Command, sourceUri string, destinationUri string) + func SaveConfig(cfg RootConfig) + func StatusWorker(c *Counters, quit chan bool, refresh_rate int, state *WorkerState, ...) + type ColConfig struct + BatchSize int + DateFilterEnabled bool + DateFilterField string + DateFilterFrom string + Enabled bool + MaxDocsInMemory int + Name string + NoFind bool + RenameTo string + SourceBatchSize int + UseMultipleWorkers bool + UseSeparateConnection bool + WorkerCount int + func GenerateColConfig(colName string, dbName string, conn *mongo.Client) ColConfig + func GetBaseColConfig() ColConfig + type ColCopyWorker struct + BatchSize int + Clients []*mongo.Client + ColName string + Config *ColConfig + DBName string + DST *mongo.Collection + Done bool + Errors []interface{} + Logs []string + SRC *mongo.Collection + SRCDocCount int64 + func (cw *ColCopyWorker) ColCopyWorker() + func (cw *ColCopyWorker) Copy(c *Counters) + func (cw *ColCopyWorker) CopyMultiThread(c *Counters, cur *mongo.Cursor) + func (cw *ColCopyWorker) CopyMultiWorker(c *Counters, q *goconcurrentqueue.FixedFIFO, done chan bool, ...) + func (cw *ColCopyWorker) CopySingleThread(c *Counters, cur *mongo.Cursor) + func (cw *ColCopyWorker) GetDocCount(db *mongo.Database) int64 + type Counters struct + Collections *int64 + CopiedItems *int64 + CopyingItems *int64 + DBs *int64 + InMemItems *int64 + Indexes *int64 + SourceItems *int64 + type DBConfig struct + BatchSize int + Collections []*ColConfig + Enabled bool + Name string + NoFind bool + RenameTo string + UseSeparateConnection bool + func GenerateDBConfig(dbName string, conn *mongo.Client) DBConfig + func GetBaseDBConfig() DBConfig + type DBConnector struct + DestURI string + SourceURI string + type RootConfig struct + BatchSize int + Databases []*DBConfig + Destination string + NoFind bool + ParalellCollectionCount int + RefreshRate int + Source string + func GenerateAllConfig(cmd *cobra.Command, sourceUri string, destinationUri string) RootConfig + func GetBaseConfig() RootConfig + func ReadAndParseConfig(path string) RootConfig + type WorkerQueue struct + Counters *Counters + Current int + Done chan bool + State *WorkerState + Workers []*ColCopyWorker + func (wq *WorkerQueue) GetNextWorker() *ColCopyWorker + func (wq *WorkerQueue) Run(cfg *RootConfig) + func (wq *WorkerQueue) RunWorker(w *ColCopyWorker, c *Counters) + type WorkerState struct + Active int