import pymongo
      
      # MongoDB database name
      db = client[""]
      
      # MongoDB collection name
      collection = db[""]
      
      # Insert Many Documents
      # `data_list` in the form of list of dictionary
      data_list = [
        {"name": "pymongo", "version": 4.1},
        {"name": "numpy", "version": 1.21},
        {"name": "pandas", "version": 1.3}
      ]
      
      collection.insert_many(data_list)

      Python language logo
      Insert Multiple Data - MongoDB

      Pymongo

      Shortcut: ins

      Filename pattern: *.py

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.