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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Environment:
    • 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 }
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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).

            Assignee:
            Benety Goh
            Reporter:
            Luke Lovett (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: