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

$avg of Infinity and null is NaN on debug builds

    • Query Optimization
    • 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

          Assignee:
          backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
          Reporter:
          robert.guo@mongodb.com Robert Guo (Inactive)
          Votes:
          0 Vote for this issue
          Watchers:
          8 Start watching this issue

            Created:
            Updated: