From 2b9b87c57b9aa56cfd28f90e0805b9da121e62b9 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Tue, 7 May 2024 23:33:45 +0800 Subject: [PATCH] fix --- vas/sync_zone_moment_price.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/vas/sync_zone_moment_price.py b/vas/sync_zone_moment_price.py index bbc01c5..039c0d3 100644 --- a/vas/sync_zone_moment_price.py +++ b/vas/sync_zone_moment_price.py @@ -25,8 +25,17 @@ for m in lis: vas_moment = col_zone_moment_price.find_one({"_id": mmid}) vas_price = safe_get_int(vas_moment, "price") - if price != vas_price: - print(mmid, price, vas_price) + if price != vas_price: + q = { + "_id": mmid, + } + up = { + "$set": { + "price": price + } + } + ret = col_zone_moment_price.update_one(q, up) + print(mmid, price, vas_price, ret.modified_count) col_zone_moment.close() col_zone_moment_price.close()