I want to run a compact operation in MongoDB over a collection but don't know which driver supports this feature and how to perform the operation. Currently using https://github.com/globalsign/mgo and do not see the compact option in its API.
Use Database.Run()
, https://godoc.org/github.com/globalsign/mgo#Database.Run. Command compact
is an administration command, https://docs.mongodb.com/manual/reference/command/compact/.