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

MinKey/MaxKey print incorrect V8

    • ALL

      The extended json spec is here: http://www.mongodb.org/display/DOCS/Mongo+Extended+JSON

      Also, this comes up with json parsing and export with mongoimport/export.

      The shell will not correctly parse the document/json representation either, but does allow $MaxKey/$MinKey (along with $ref,$id,$db) through on validation incorrectly.

      //V8 v2.3.2--pre
      > MaxKey
      { "$MaxKey" : true } // wrong
      > db.max.find()
      { "_id" : { "$MinKey" : true } }
      { "_id" : { "$MaxKey" : true } }
      > db.max.find({_id:{$type:-1}})
      { "_id" : { "$MinKey" : true } }
      > db.max.find({_id:{$type:0x7f}})
      { "_id" : { "$MaxKey" : true } }
      > tojson(MaxKey)
      { "$maxKey" : 1 }
      > db.max.insert({_id:{$MaxKey:true}})
      > db.max.count()
      3
      
      //SM 2.2.2
      > MaxKey
      { "$maxKey" : 1 }
      > db.max.find()
      { "_id" : { $minKey : 1 } }
      { "_id" : { $maxKey : 1 } }
      > db.max.find({_id:{$type:-1}})
      { "_id" : { $minKey : 1 } }
      > db.max.find({_id:{$type:0x7f}})
      { "_id" : { $maxKey : 1 } }
      > tojson(MaxKey)
      { "$maxKey" : 1 }
      > db.max.insert({_id:{$MaxKey:true}})
      > db.max.count()
      3
      

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: