mongo shard + maxSize I have a sharded cluster (mongo 3.2). I'm trying to set a Maximum Storage Size for a Given Shard, but it fails.

mongos&gt; show dbs
DB_files  820.835GB
config      0.012GB
mongos&gt; config = db.getSiblingDB("config")
config
mongos&gt; config.shards.updateOne({ "_id": "shard0000"},{$set : { "maxSize": 4194304 }})
2016-12-21T15:47:00.467-0300 TypeError: Property 'updateOne' of object config.shards is not a function


So I tried something else:

mongos&gt; use config
switched to db config
mongos&gt; show collections
shards
actionlog
chunks
mongos
collections
lockpings
settings
version
locks
databases
tags
changelog
mongos&gt; db.shards.updateOne({ "_id": "shard0000"},{$set : { "maxSize": 4194304 }})
2016-12-21T15:50:05.842-0300 TypeError: Property 'updateOne' of object config.shards is not a function


The shading is working, balancing, etc. 

mongos&gt; db.shards.find({ "_id": "shard0000"})
{ "_id" : "shard0000", "host" : "mongosh1:27017" }
mongos&gt; sh.status()
--- Sharding Status ---
  sharding version: {
        "_id" : 1,
        "minCompatibleVersion" : 5,
        "currentVersion" : 6,
        "clusterId" : ObjectId("57cf4769b7dc19454fe95604")
} 
  shards:
        {  "_id" : "shard0000",  "host" : "mongosh1:27017" }
        {  "_id" : "shard0001",  "host" : "mongosh2:27017" }
  databases:
        {  "_id" : "DB_files",  "primary" : "shard0000",  "partitioned" : true }
                DB_files.fs.chunks
                        shard key: { "files_id" : 1, "n" : 1 }
                        chunks: 
                                shard0001       9136
                                shard0000       9136
                        too many chunks to print, use verbose if you want to force print


Any ideas?
Most likely you are using a different shell version than the db version. That is, the output of db.version() (the server version) and version() (the shell version) should be the same.

For example:

mongos&gt; db.version()
3.4.1
mongos&gt; version()
2.6.12
mongos&gt; config = db.getSiblingDB('config')
config
mongos&gt; config.shards.updateOne({_id:'shard01'},{$set:{maxSize:4194304}})
2016-12-22T13:22:56.154+1100 TypeError: Property 'updateOne' of object config.shards is not a function


Note the identical error message to the one you're seeing. This is because updateOne function doesn't exist in early mongo shell. However, using the correct version:

mongos&gt; db.version()
3.4.1
mongos&gt; version()
3.4.1
mongos&gt; config = db.getSiblingDB('config')
config
mongos&gt; config.shards.updateOne({_id:'shard01'},{$set:{maxSize:4194304}})
{
  "acknowledged": true,
  "matchedCount": 1,
  "modifiedCount": 1
}