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

Unrecognized pipeline stage name: '$count'

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.3
    • Component/s: Aggregation Framework
    • Labels:
      None
    • ALL

      ubuntu@ip-172-31-26-220:~/code$ mongod --version
      db version v3.2.3
      git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
      OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
      allocator: tcmalloc
      modules: none
      build environment:
          distmod: ubuntu1404
          distarch: x86_64
          target_arch: x86_64
      
      > db.scores.find()
      { "_id" : 1, "subject" : "History", "score" : 88 }
      { "_id" : 2, "subject" : "History", "score" : 92 }
      { "_id" : 3, "subject" : "History", "score" : 97 }
      { "_id" : 4, "subject" : "History", "score" : 71 }
      { "_id" : 5, "subject" : "History", "score" : 79 }
      { "_id" : 6, "subject" : "History", "score" : 83 }
      > 
      
      > db.scores.aggregate(
      ...   [
      ...     {
      ...       $match: {
      ...         score: {
      ...           $gt: 80
      ...         }
      ...       }
      ...     },
      ...     {
      ...       $count: "passing_scores"
      ...     }
      ...   ]
      ... )
      assert: command failed: {
              "ok" : 0,
              "errmsg" : "Unrecognized pipeline stage name: '$count'",
              "code" : 16436
      } : aggregate failed
      _getErrorWithCode@src/mongo/shell/utils.js:23:13
      doassert@src/mongo/shell/assert.js:13:14
      assert.commandWorked@src/mongo/shell/assert.js:266:5
      DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1215:5
      @(shell):1:1
      
      2016-12-08T20:48:42.551+0800 E QUERY    [thread1] Error: command failed: {
              "ok" : 0,
              "errmsg" : "Unrecognized pipeline stage name: '$count'",
              "code" : 16436
      } : aggregate failed :
      _getErrorWithCode@src/mongo/shell/utils.js:23:13
      doassert@src/mongo/shell/assert.js:13:14
      assert.commandWorked@src/mongo/shell/assert.js:266:5
      DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1215:5
      @(shell):1:1
      
      > 
      

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            narychen Roben
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: