diff --git a/src/serra/root.go b/src/serra/root.go index a5c77d2..fab992d 100644 --- a/src/serra/root.go +++ b/src/serra/root.go @@ -191,8 +191,20 @@ func Stats() { sets, _ := coll.storage_aggregate(groupStage) for _, set := range sets { - // TODO fix primitiveA Problem with loop and reflect fmt.Printf("* %s %d\n", set["_id"], set["count"]) } + + LogMessage(fmt.Sprintf("Mana costs in Collection"), "green") + groupStage = bson.D{ + {"$group", bson.D{ + {"_id", "$manacost"}, + {"count", bson.D{{"$sum", 1}}}, + }}} + m, _ := coll.storage_aggregate(groupStage) + + for _, manacosts := range m { + // TODO fix primitiveA Problem with loop and reflect + fmt.Printf("* %s %d\n", manacosts["_id"], manacosts["count"]) + } }