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.
1条回答 默认 最新
- douou5933 2019-05-12 17:11关注
Use
Database.Run()
, https://godoc.org/github.com/globalsign/mgo#Database.Run. Commandcompact
is an administration command, https://docs.mongodb.com/manual/reference/command/compact/.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报