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

Geo-indexing + Max fails when max is very large

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.9.0
    • Affects Version/s: 1.8.0-rc2
    • Component/s: None
    • None
    • Environment:
      Ubuntu and Windows

      To repro run the following commands against an empty db.

      > db.tri.ensureIndex(

      { c: '2d', t: 1 }

      ,

      { min: 0, max: Math.pow(2, 40) }

      )
      > db.tri.insert(

      { c : [1,1], t : 1}

      )
      point not in range
      > db.system.indexes.find()
      { "name" : "id", "ns" : "localhost.tri", "key" :

      { "_id" : 1 }

      , "v" : 0 }
      { "_id" : ObjectId("4d796ffa3996d83589c67397"), "ns" : "localhost.tri", "key" :

      { "c" : "2d", "t" : 1 }

      , "name" : "c__t_1", "min" : 0, "max" : 1099511627776 }

      So we're creating a Geo index with a very large max. It's obviously not too large as the index correctly saves / displays the number. However, when we insert data, that index throws the "point not in range" error.

      Math.pow(2,30) => works correctly
      Math.pow(2,31) => breaks

      (integer vs numberlong issue?)

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            gatesvp Gaetan Voyer-Perrault
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: