pymongo insert_many 批量插入
lt=client.fangjia.district_stat_all_0416
dl = dt.find(query)
bf=[]
for m in dl:
bf.append(m)
if len(bf)==20000:
lt.insert_many(bf)
bf=[]
lt.insert_many(bf)
lt=client.fangjia.district_stat_all_0416
dl = dt.find(query)
bf=[]
for m in dl:
bf.append(m)
if len(bf)==20000:
lt.insert_many(bf)
bf=[]
lt.insert_many(bf)