Fix calc stats
This commit is contained in:
parent
de5d07e150
commit
e128985741
@ -110,7 +110,7 @@ var updateCmd = &cobra.Command{
|
|||||||
// calculate total summary over all sets
|
// calculate total summary over all sets
|
||||||
overall_value := mongo.Pipeline{
|
overall_value := mongo.Pipeline{
|
||||||
bson.D{{"$match",
|
bson.D{{"$match",
|
||||||
bson.D{{"serra_prices", bson.D{{"$exists", true}}}}}},
|
bson.D{{"serra_prices", bson.D{{"$type", "array"}}}}}},
|
||||||
bson.D{{"$project",
|
bson.D{{"$project",
|
||||||
bson.D{{"name", true}, {"totalValue", bson.D{{"$arrayElemAt", bson.A{"$serra_prices", -1}}}}}}},
|
bson.D{{"name", true}, {"totalValue", bson.D{{"$arrayElemAt", bson.A{"$serra_prices", -1}}}}}}},
|
||||||
bson.D{{"$group", bson.D{{"_id", nil}, {"total", bson.D{{"$sum", "$totalValue.value"}}}}}},
|
bson.D{{"$group", bson.D{{"_id", nil}, {"total", bson.D{{"$sum", "$totalValue.value"}}}}}},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user