added another for getMore

This commit is contained in:
Pavel 2024-08-04 10:18:15 +03:00
parent 78c38993d3
commit e4a4459c1e

@ -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)
}