From e4a4459c1e65dc677fb1c4b36be5aa469dd48bea Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 4 Aug 2024 10:18:15 +0300 Subject: [PATCH] added another for getMore --- mongo/connection.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) }