update prices
This commit is contained in:
parent
3a17b20a3f
commit
95ca072544
@ -24,3 +24,9 @@ optional
|
||||
|
||||
* Gives a shit about conditions (NM, M, GD...)
|
||||
* If the card is foil
|
||||
|
||||
# Cheatsheet
|
||||
|
||||
Find cards that increased prices
|
||||
|
||||
db.cards.find({$expr: {$gt: [{$arrayElemAt: ["$serra_prices", -2]}, {$arrayElemAt: ["$serra_prices", -1]}]}}, {name:1})
|
||||
|
||||
12
serra.go
12
serra.go
@ -26,17 +26,11 @@ Options:
|
||||
|
||||
if args["add"].(bool) {
|
||||
serra.Add(args["<card>"].([]string))
|
||||
}
|
||||
|
||||
if args["cards"].(bool) {
|
||||
} else if args["cards"].(bool) {
|
||||
serra.Cards()
|
||||
}
|
||||
|
||||
if args["sets"].(bool) {
|
||||
} else if args["sets"].(bool) {
|
||||
serra.Sets()
|
||||
}
|
||||
|
||||
if args["update"].(bool) {
|
||||
} else if args["update"].(bool) {
|
||||
serra.Update()
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ func Update() {
|
||||
filter := bson.M{"_id": bson.M{"$eq": card.ID}}
|
||||
|
||||
update := bson.M{
|
||||
"$set": bson.M{"serra_updated": primitive.NewDateTimeFromTime(time.Now())},
|
||||
"$set": bson.M{"serra_updated": primitive.NewDateTimeFromTime(time.Now()), "prices": updated_card.Prices},
|
||||
"$push": bson.M{"serra_prices": bson.M{"date": primitive.NewDateTimeFromTime(time.Now()),
|
||||
"value": updated_card.Prices.Eur}}}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user