Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1318

Nested Javascript objects are not fully printed at db.printShardingStatus()

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.6.0
    • Component/s: None
    • None
    • 3

      Sometimes when I run db.printShardingStatus() in mongosh then database objects are not properly printed, I get this output:

       

      db.printShardingStatus()
      ...
      databases
      [
        { database: [Object], collections: [Object] },
        { database: [Object], collections: {} },
        { database: [Object], collections: {} },
        { database: [Object], collections: [Object] },
        { database: [Object], collections: {} },
        { database: [Object], collections: {} },
        { database: [Object], collections: {} },
        { database: [Object], collections: {} }
      ]

      In my settings I have config.set("inspectDepth", 12), so this should be fine.

      Often (but not always) the output is correct like

      databases
      [
        {
          database: { _id: 'config', primary: 'config', partitioned: true },
          collections: {
            'config.system.sessions': {
              shardKey: { _id: 1 },
              unique: false,
              balancing: true,
              chunkMetadata: [
                { shard: 'shard_01', nChunks: 256 },
                { shard: 'shard_02', nChunks: 256 },
                { shard: 'shard_03', nChunks: 256 },
                { shard: 'shard_04', nChunks: 256 }
              ],
              chunks: [
                'too many chunks to print, use verbose if you want to force print'
              ],
              tags: []
            }
          }
        },
      
      ...
      
      

      I did not manage it to reproduce the error.

      I tried to start mongosh with and without --norc (in my .mongoshrc.js I load mongocompat snippets). I tried to delete ~/.mongodb/mongosh/config but nothing showed the wrong output intentionally.

       

      Any idea to make the output consistent?

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            wernfried.domscheit@sunrise.net Wernfried Domscheit
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: