diff --git a/sources/mongo/snapshot.go b/sources/mongo/snapshot.go index 4c9442ac..7149c925 100644 --- a/sources/mongo/snapshot.go +++ b/sources/mongo/snapshot.go @@ -3,14 +3,16 @@ package mongo import ( "context" "fmt" - "github.com/artie-labs/reader/config" - "github.com/artie-labs/reader/lib" - "github.com/artie-labs/reader/lib/iterator" - mongo2 "github.com/artie-labs/reader/lib/mongo" + "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/artie-labs/reader/config" + "github.com/artie-labs/reader/lib" + "github.com/artie-labs/reader/lib/iterator" + mongoLib "github.com/artie-labs/reader/lib/mongo" ) type snapshotIterator struct { @@ -80,7 +82,7 @@ func (s *snapshotIterator) Next() ([]lib.RawMessage, error) { return nil, fmt.Errorf("failed to decode document: %w", err) } - mgoMsg, err := mongo2.ParseMessage(result, nil, "r") + mgoMsg, err := mongoLib.ParseMessage(result, nil, "r") if err != nil { return nil, fmt.Errorf("failed to parse message: %w", err) } diff --git a/sources/mongo/streaming.go b/sources/mongo/streaming.go index 8350fb0b..d1c6aeee 100644 --- a/sources/mongo/streaming.go +++ b/sources/mongo/streaming.go @@ -4,7 +4,6 @@ import ( "context" "encoding/base64" "fmt" - mongo2 "github.com/artie-labs/reader/lib/mongo" "log/slog" "time" @@ -15,6 +14,7 @@ import ( "github.com/artie-labs/reader/config" "github.com/artie-labs/reader/lib" "github.com/artie-labs/reader/lib/iterator" + mongoLib "github.com/artie-labs/reader/lib/mongo" "github.com/artie-labs/reader/lib/persistedmap" ) @@ -109,7 +109,7 @@ func (s *streaming) Next() ([]lib.RawMessage, error) { return nil, fmt.Errorf("failed to decode change event: %w", err) } - changeEvent, err := mongo2.NewChangeEvent(rawChangeEvent) + changeEvent, err := mongoLib.NewChangeEvent(rawChangeEvent) if err != nil { return nil, fmt.Errorf("failed to parse change event: %w", err) }