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

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

      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

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

              Created:
              Updated:
              Resolved:
              2 years, 12 weeks, 4 days ago