diff --git a/mongo/connection.go b/mongo/connection.go index 49aad4e..9356682 100644 --- a/mongo/connection.go +++ b/mongo/connection.go @@ -30,16 +30,28 @@ func Connect(ctx context.Context, deps *ConnectDeps) (*mongo.Database, error) { cmdMonitor := &event.CommandMonitor{ Started: func(_ context.Context, evt *event.CommandStartedEvent) { + if evt.CommandName == "getMore" { + log.Println(evt.Command) + } + if evt.CommandName == "find" { log.Println(evt.Command) } }, Succeeded: func(_ context.Context, evt *event.CommandSucceededEvent) { + if evt.CommandName == "getMore" { + log.Println(evt.Reply) + } + if evt.CommandName == "find" { log.Println(evt.Reply) } }, Failed: func(_ context.Context, evt *event.CommandFailedEvent) { + if evt.CommandName == "getMore" { + log.Println(evt.Failure) + } + if evt.CommandName == "find" { log.Println(evt.Failure) }