func (compare *MongoCompare) shouldSkipCollection(colName string) bool {
	for _, excludedCollection := range compare.OutputOptions.ExcludedCollections {
		if colName == excludedCollection {
			return true
		}
	}
	for _, excludedCollectionPrefix := range compare.OutputOptions.ExcludedCollectionPrefixes {
		if strings.HasPrefix(colName, excludedCollectionPrefix) {
			return true
		}
	}
	return false
}
shouldSkipCollection returns true when a collection name is excluded
by the mongodump options.
package mongocompare
import (
	"context"
	"crypto/sha1"
	"encoding/base64"
	"fmt"
	"github.com/mongodb/mongo-tools-common/db"
	"github.com/mongodb/mongo-tools-common/intents"
	"github.com/mongodb/mongo-tools-common/log"
	"github.com/mongodb/mongo-tools-common/util"
	"io"
	"os"
	"path/filepath"
	"strings"
)
type NilPos struct{}
func (NilPos) Pos() int64 {
	return -1
}
type writeFlusher interface {
	Flush() error
	io.Writer
}
type writeFlushCloser struct {
	writeFlusher
}
type errorReader struct{}
func (errorReader) Read([]byte) (int, error) {
	return 0, os.ErrInvalid
}
func (bwc writeFlushCloser) Close() error {
	return bwc.Flush()
}
type realBSONFile struct {
	io.WriteCloser
	path string
	errorReader
	intent *intents.Intent
	NilPos
}
func (f *realBSONFile) Open() (err error) {
	if f.path == "" {
		return fmt.Errorf("error creating BSON file without a path, namespace: %v",
			f.intent.Namespace())
	}
	err = os.MkdirAll(filepath.Dir(f.path), os.ModeDir|os.ModePerm)
	if err != nil {
		return fmt.Errorf("error creating directory for BSON file %v: %v",
			filepath.Dir(f.path), err)
	}
	f.WriteCloser, err = os.Create(f.path)
	if err != nil {
		return fmt.Errorf("error creating BSON file %v: %v", f.path, err)
	}
	return nil
}
type realMetadataFile struct {
	io.WriteCloser
	path string
	errorReader
	intent *intents.Intent
	NilPos
}
func (f *realMetadataFile) Open() (err error) {
	if f.path == "" {
		return fmt.Errorf("No metadata path for %v.%v", f.intent.DB, f.intent.C)
	}
	err = os.MkdirAll(filepath.Dir(f.path), os.ModeDir|os.ModePerm)
	if err != nil {
		return fmt.Errorf("error creating directory for metadata file %v: %v",
			filepath.Dir(f.path), err)
	}
	f.WriteCloser, err = os.Create(f.path)
	if err != nil {
		return fmt.Errorf("error creating metadata file %v: %v", f.path, err)
	}
	return nil
}
type stdoutFile struct {
	io.Writer
	errorReader
	NilPos
}
func (f *stdoutFile) Open() error {
	return nil
}
func (f *stdoutFile) Close() error {
	f.Writer = nil
	return nil
}
func shouldSkipSystemNamespace(dbName, collName string) bool {
	switch dbName {
	case "admin":
		if collName == "system.keys" {
			return true
		}
	case "config":
		if collName == "transactions" || collName == "system.sessions" || collName == "transaction_coordinators" || collName == "system.indexBuilds" {
			return true
		}
	default:
		if collName == "system.js" {
			return false
		}
		if strings.HasPrefix(collName, "system.") {
			return true
		}
	}
	if strings.Contains(collName, "$") && !strings.Contains(collName, ".oplog.$") {
		return true
	}
	return false
}