在数据库中创建数据库、表,插入数据。 

from pymongo import MongoClient
host = "localhost"
port = 27017

client = MongoClient(host, port)
db = client['test']
sheet = db['sheet']
for i in range(1001):
   print(i)
   sheet.instert_one(
   {
     'name': 'name'+ str(i),
     'age': i,
   })

  

相关文章:

  • 2021-07-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-19
  • 2021-12-12
  • 2021-11-06
相关资源
相似解决方案