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

$avg of Infinity and null is NaN on debug builds

    XMLWordPrintable

Details

    • ALL
    • 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.
    • 0

    Attachments

      Issue Links

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            robert.guo@mongodb.com Robert Guo
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: