Skip to content

Instantly share code, notes, and snippets.

@samantharitter
Last active September 28, 2017 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samantharitter/1d40e85156371af2b8615e6c475ba70c to your computer and use it in GitHub Desktop.
Save samantharitter/1d40e85156371af2b8615e6c475ba70c to your computer and use it in GitHub Desktop.
// New listDatabases format for 3.6:
// ---------------------------------
// - reports shards for the "config" db, which may be sharded in 3.6.
// - includes sizes from all shards in the size total for the "config" db.
// - reports config shard for the "admin" db, for consistency and clarity,
// and to make automated parsing of this command simpler for end users.
// - sorts "admin" and "config" into the alphabetizes list of databases.
{
"databases" : [
{
"name" : "admin",
"sizeOnDisk" : 16384,
"empty" : false,
"shards" : {
"config" : 16384
}
},
{
"name" : "config",
"sizeOnDisk" : 176128,
"empty" : false,
"shards" : {
"c1a" : 28672,
"c1b" : 8192,
"config" : 139264
}
},
{
"name" : "test",
"sizeOnDisk" : 12288,
"empty" : false,
"shards" : {
"c1a" : 12288
}
}
],
"totalSize" : 204800,
"totalSizeMb" : 0,
"ok" : 1
}
// Old format of listDatabases:
// ---------------------------
// - only collects info on "admin" and "config" dbs from the config servers.
// - "admin" and "config" dbs are reported out of alphabetical order.
{
"databases" : [
{
"name" : "test",
"sizeOnDisk" : 12288,
"empty" : false,
"shards" : {
"c1a" : 12288
}
},
{
"name" : "admin",
"sizeOnDisk" : 16384,
"empty" : false
},
{
"name" : "config",
"sizeOnDisk" : 139264,
"empty" : false
}
],
"totalSize" : 167936,
"totalSizeMb" : 0,
"ok" : 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment