Catch non-existent reserved list bug
This commit is contained in:
parent
f6621e9bd8
commit
ed1bb5c5a4
@ -76,7 +76,12 @@ var statsCmd = &cobra.Command{
|
||||
{"count", bson.D{{"$sum", 1}}},
|
||||
}}},
|
||||
})
|
||||
fmt.Printf("Reserved List: %s%d%s\n", Yellow, reserved[0]["count"], Reset)
|
||||
|
||||
var count_reserved float64
|
||||
if len(reserved) > 0 {
|
||||
count_reserved = reserved[0]["count"].(float64)
|
||||
}
|
||||
fmt.Printf("Reserved List: %s%.0f%s\n", Yellow, count_reserved, Reset)
|
||||
|
||||
rar, _ := coll.storage_aggregate(mongo.Pipeline{
|
||||
bson.D{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user