#python #mongodb
Вопрос:
iso_sales_dt = '2021-10-01 00:00:01' sales_dt = datetime.fromisoformat(iso_sales_dt) cursor1 = db.SalesHistories.find( { "$and": [ {"RetailerCompanyId": 1}, {"RetailerSubsidiaryId": 1}, {"SalesDateAndTime": {"$gt": sales_dt}}, {"UserId": {"$exists": True,"$ne": None}}, {"ItemId": {"$exists": True,"$ne": None}}, {"StoreId": {"$in": store_ids,"$exists": True,"$ne": None}}, {"UserReceiptId": {"$exists": True,"$ne": None}}, {"SalesPriceWithTax": {"$exists": True,"$ne": None}}, {"IsReturnItem": {"$exists": True,"$ne": None}}, {"FamilyTree": {"$exists": True,"$ne": []}}, { "FamilyTree.CategoryType": "BUMON_CODE", "FamilyTree.RemoteCategoryId": {"$nin": skipped_bumon_codes}, }, ] }, {"UserId":1, "ItemId":1, "StoreId":1, "UserReceiptId":1, "SalesPriceWithTax":1, "FamilyTree":1,"IsReturnItem":1,"_id":0,"SalesDateAndTime": 1}, batch_size=1000000, )
При первом запуске диапазон извлеченных данных составляет 10,1 ~ 10,8. При втором запуске диапазон извлеченных данных составляет 10,1 ~ 10,7. Любопытно, почему он отличается?