Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-6463

Comment on: "manual/reference/method/db.createCollection.txt"

    XMLWordPrintableJSON

Details

    Description

      The manual is inconsistent.

      The size field is required for capped collections and ignored for other collections.

      and

      The following command simply pre-allocates a 2-gigabyte, uncapped collection named people:

      db.createCollection("people", { size: 2147483648 } )
      

      Unfortunately, the former is true.

      > db.createCollection("people", { size: 2147483648 } )
      { "ok" : 1 }
      > db.people.stats()
      {
      	"ns" : "test.people",
      	"count" : 0,
      	"size" : 0,
      	"numExtents" : 1,
      	"storageSize" : 8192,
      	"lastExtentSize" : 8192,
      	"paddingFactor" : 1,
      	"paddingFactorNote" : "paddingFactor is unused and unmaintained in 3.0. It remains hard coded to 1.0 for compatibility only.",
      	"userFlags" : 1,
      	"capped" : false,
      	"nindexes" : 1,
      	"totalIndexSize" : 8176,
      	"indexSizes" : {
      		"_id_" : 8176
      	},
      	"ok" : 1
      }
      

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5 years, 17 weeks ago