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

$avg of Infinity and null is NaN on debug builds

    XMLWordPrintable

    Details

    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      MongoDB Enterprise > db.test.find()
      { "_id" : 1, "a" : Infinity }
      { "_id" : 2, "a" : null }
      MongoDB Enterprise > db.test.aggregate([{$group:{_id: null, num:{$avg:"$a"}}}])
      { "_id" : null, "num" : NaN } // debug build
      { "_id" : null, "num" : Infinity } // non-debug build, correct behavior.
      

      Show
      MongoDB Enterprise > db.test.find() { "_id" : 1, "a" : Infinity } { "_id" : 2, "a" : null } MongoDB Enterprise > db.test.aggregate([{$group:{_id: null, num:{$avg:"$a"}}}]) { "_id" : null, "num" : NaN } // debug build { "_id" : null, "num" : Infinity } // non-debug build, correct behavior.
    • Linked BF Score:
      0

      Attachments

        Issue Links

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: