新增m_date周边
This commit is contained in:
@@ -6,6 +6,7 @@ from goojia_utils import MAIN_MONGO_CLIENT, process_dataframe_multithread
|
||||
import pandas as pd
|
||||
from pymongo import UpdateOne
|
||||
import poiutils
|
||||
from datetime import datetime
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -58,7 +59,7 @@ def sync_new(distance=3000):
|
||||
action = UpdateOne({'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name']},
|
||||
{'$set': {'bus': item['bus'], 'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'], 'distance': distance}},
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'], 'm_date': datetime.now(), 'distance': distance}},
|
||||
upsert=True)
|
||||
actions.append(action)
|
||||
except Exception as e:
|
||||
@@ -95,7 +96,7 @@ def sync1():
|
||||
action = UpdateOne({'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name']},
|
||||
{'$set': {'bus': item['bus'], 'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat']}},
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'], 'm_date': datetime.now()}},
|
||||
upsert=True)
|
||||
actions.append(action)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user