Skip system.* tables during compact. #22

Merged
merged 1 commit into from Oct 26, 2017
Jump to file or symbol
Failed to load files and symbols.
+4 −0
Split
@@ -6,6 +6,7 @@ package main
import (
"errors"
"fmt"
+ "strings"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
@@ -62,6 +63,9 @@ func compactAll(db *mgo.Database) error {
return fmt.Errorf("obtaining collection names: %v", err)
}
for _, name := range names {
+ if strings.HasPrefix(name, "system.") {
+ continue
+ }
logger.Infof("compacting %s", name)
err := db.Run(bson.D{
{"compact", name},