Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19747

MinKey/MaxKey not printing as JSON in MozJS

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.7
    • Affects Version/s: None
    • Component/s: JavaScript
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Platform 7 08/10/15

      Against master:

      > MinKey
      [object MinKey]
      > MaxKey
      [object MaxKey]
      > tojson(MinKey)
      [object MinKey]
      > tojson(MaxKey)
      [object MaxKey]
      

      The corresponding historical output (eg. in 3.1.6) is:

      > MinKey
      { "$minKey" : 1 }
      > MaxKey
      { "$maxKey" : 1 }
      > tojson(MinKey)
      { "$minKey" : 1 }
      > tojson(MaxKey)
      { "$maxKey" : 1 }
      

      Among other things, leads to strangeness in the output of sh.status():

      ...
      {  "_id" : "test",  "primary" : "shard0000",  "partitioned" : true }
              test.test1
                      shard key: { "_id" : 1 }
                      chunks:
                              shard0000       1
      >>>>>>>>>>      { "_id" : [object MinKey] } -->> { "_id" : [object MaxKey] } on : shard0000 Timestamp(1, 0)
      ...
      

      Whereas this used to be:

      ...
      {  "_id" : "test",  "primary" : "shard0000",  "partitioned" : true }
              test.test1
                      shard key: { "_id" : 1 }
                      chunks:
                              shard0000       1
      >>>>>>>>>>      { "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : shard0000 Timestamp(1, 0)
      ...
      

            Assignee:
            mira.carey@mongodb.com Mira Carey
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: