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

date max index bound value looks messed up in shell as IsoDate

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: JavaScript
    • Fully Compatible
    • ALL

      > c.find({a:{$gt:new Date()}} ).explain()
      {
      "cursor" : "BtreeCursor a_1",
      "nscanned" : 0,
      "nscannedObjects" : 0,
      "n" : 0,
      "millis" : 0,
      "nYields" : 0,
      "nChunkSkips" : 0,
      "isMultiKey" : false,
      "indexOnly" : false,
      "indexBounds" :

      { "a" : [ [ ISODate("2011-10-31T20:13:32.168Z"), ISODate("292278995-01--2147483647T07:12:56.808Z") ] ] }

      }

      > c.find({a:{$gt:new Date()}} ).explain().indexBounds.a[0][1].valueOf()
      9223372036854776000

      I think this value is generated by

      void BSONObjBuilder::appendMaxForType( const StringData& fieldName , int t ) {
      ....
      ....
      case Date:
      appendDate( fieldName , numeric_limits<long long>::max() ); return;

      Potentially this numeric value is invalid for a javascript date, but we might want to do something so the output looks a little nicer.

      Also, there could potentially be other issues relating to date values outside an allowed js date range (round tripping, $where style queries, etc). So might be worth spending some time looking into these.

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: