Can I get the query that gets executed by the MongoDB Golang driver when collection.Aggregate() executes on a pipeline?

Viewed 12

I'm using the MongoDB driver for Golang. I have a pipeline setup below. Is there a way I can see the query that gets executed by the call to collection.Aggregate() ala Hibernate?

pipeline := mongo.Pipeline{ {{"$match", bson.D{ {"created_time", bson.D{ {"$lt", primitive.NewDateTimeFromTime(expireTimeLimit)}}}, {"archived", bson.D{{"$eq", true}}}}, }}}

aggregateCursor, err := collection.Aggregate(ctx, pipeline)

0 Answers
Related