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

Documents with value Infinity for index key not returned in query in 2.4

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • None
    • None
    • Querying
    • Fully Compatible
    • ALL
    • Hide

      2.4.9-pre-

      > db.c.insert({a:Infinity})
      > db.c.find({a:{$gt:0}})
      { "_id" : ObjectId("528ffb985142cd7d1e23d1cf"), "a" : Infinity }
      > db.c.ensureIndex({a:1})
      > db.c.find({a:{$gt:0}})

      2.5.5-pre-

      > db.c.insert({a:Infinity})
      Insert WriteResult({ "ok" : 1, "n" : 1 })
      > db.c.find({a:{$gt:0}})
      { "_id" : ObjectId("528ffb986ce2fec2710a136f"), "a" : Infinity }
      > db.c.ensureIndex({a:1})
      > db.c.find({a:{$gt:0}})
      { "_id" : ObjectId("528ffb986ce2fec2710a136f"), "a" : Infinity }

      Show
      2.4.9-pre- > db.c.insert({a:Infinity}) > db.c.find({a:{$gt:0}}) { "_id" : ObjectId("528ffb985142cd7d1e23d1cf"), "a" : Infinity } > db.c.ensureIndex({a:1}) > db.c.find({a:{$gt:0}}) 2.5.5-pre- > db.c.insert({a:Infinity}) Insert WriteResult({ "ok" : 1, "n" : 1 }) > db.c.find({a:{$gt:0}}) { "_id" : ObjectId("528ffb986ce2fec2710a136f"), "a" : Infinity } > db.c.ensureIndex({a:1}) > db.c.find({a:{$gt:0}}) { "_id" : ObjectId("528ffb986ce2fec2710a136f"), "a" : Infinity }

    Description

      A document that has the value Infinity for a key that is indexed is not returned in queries that use that index in MongoDB version 2.4. Version 2.5 does not seem to have this issue. Seems like there should be a fix for 2.4 or this change in behavior between versions be documented (if it is intentional).

      Attachments

        Issue Links

          Activity

            People

              benety.goh@mongodb.com Benety Goh
              luke.lovett Luke Lovett
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: