优化小区同步

This commit is contained in:
shenjian@fangjia.com
2023-01-05 10:07:17 +08:00
parent 63bd1d6f00
commit 5cc2f43ca8
+4 -2
View File
@@ -26,8 +26,10 @@ def sync_district_office(type):
for doc in seaweed_conn.find({'city': city, 'cat': type, 'status': 0}, {'city': 1, 'region': 1, 'block': 1, 'cat': 1, 'name': 1, 'address': 1,
'estate_type2': 1, 'township': 1, 'alias': 1, 'addr_alias': 1, 'lng': 1, 'lat': 1, 'status': 1})\
.batch_size(10000):
updateDict = {'city': doc['city'], 'region': doc['region'], 'category': doc['cat'], 'name': doc['name'],
'estate_type': doc['estate_type2'], 'status': doc['status']}
updateDict = {'city': doc['city'], 'region': doc['region'], 'category': doc['cat'], 'name': doc['name'], 'status': doc['status']}
if 'estate_type2' in doc:
updateDict['estate_type'] = doc['estate_type2']
id_list.append({'_id': doc['_id']})
if 'block' in doc:
updateDict['block'] = doc['block']