File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
1616 "strings"
1717
1818 "go.mongodb.org/mongo-driver/v2/bson"
19+ "go.mongodb.org/mongo-driver/v2/event"
1920 "go.mongodb.org/mongo-driver/v2/internal/bsonutil"
2021 "go.mongodb.org/mongo-driver/v2/internal/driverutil"
2122 "go.mongodb.org/mongo-driver/v2/internal/handshake"
@@ -639,6 +640,14 @@ func (h *Hello) createOperation() driver.Operation {
639640 },
640641 ServerAPI : h .serverAPI ,
641642 OmitMaxTimeMS : h .omitMaxTimeMS ,
643+ CommandMonitor : & event.CommandMonitor {
644+ Started : func (ctx context.Context , e * event.CommandStartedEvent ) {
645+ fmt .Println ("Hello started:" , e .CommandName , e .Command )
646+ },
647+ Succeeded : func (ctx context.Context , e * event.CommandSucceededEvent ) {
648+ fmt .Println ("Hello succeeded:" , e .CommandName , e .Reply )
649+ },
650+ },
642651 }
643652
644653 if isLegacyHandshake (h .serverAPI , h .loadBalanced ) {
You can’t perform that action at this time.
0 commit comments