Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2353

Update create_collection docs with more options

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1
    • Affects Version/s: None
    • Component/s: Docs

      Inspired by this post: https://developer.mongodb.com/community/forums/t/defining-data-schema-using-pymongo/8533

      The create_collection documentation to includes a few command-level options: https://pymongo.readthedocs.io/en/stable/api/pymongo/database.html#pymongo.database.Database.create_collection

      Options should be passed as keyword arguments to this method. Supported options vary with MongoDB release. Some examples include:
      
      “size”: desired initial size for the collection (in bytes). For capped collections this size is the max size of the collection.
      “capped”: if True, this is a capped collection
      “max”: maximum number of objects if capped (optional)
      

      We should update the create_collection documentation to include more modern command options like validator, viewOn, pipeline. We should also link to the docs page for the create command: https://docs.mongodb.com/manual/reference/command/create/

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: