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

[Server] Change insert() to upsert in page "Modify Chunk Size in a Sharded Cluster"

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 5.0.0, 5.2.0
    • 5.0.0, 5.2.0, 5.3.0
    • manual, Server
    • None

    Description

      Hi team,

      In the page Modify Chunk Size in a Sharded Cluster, the command to modify the maximum chunk size is:

      db.settings.insertOne( { _id:"chunksize", value: <sizeInMB> } )
      

      However, if the maximum chunk size has already been modified, this returns a "duplicate key error".

      Instead, this command should be an upsert so it's repeatable:

      db.settings.updateOne( { _id:"chunksize" }, { $set: { _id:"chunksize", value: <sizeInMB> } }, { upsert: true } )
      

      Thanks,
      Matt

      Attachments

        Activity

          People

            joseph.dougherty@mongodb.com Joseph Dougherty
            matt.javaly@mongodb.com Matthew Javaly
            Joseph Dougherty Joseph Dougherty
            Jason Price Jason Price
            Matthew Javaly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              29 weeks, 6 days ago