Chapter 2 Lab 1 - Cursor like stages

Getting following error when running $match followed by $addfields in a pipeline.

2018-10-22T14:03:53.192-0400 E QUERY [js] Error: command failed: {
“operationTime” : Timestamp(1540231430, 1),
“ok” : 0,
“errmsg” : “Unrecognized pipeline stage name: ‘$addfields’”,
“code” : 40324,
“codeName” : “Location40324”,
“$clusterTime” : {
“clusterTime” : Timestamp(1540231430, 1),
“signature” : {
“hash” : BinData(0,“xMTobiBasZmGBeXQfmIDQGOxJAY=”),
“keyId” : NumberLong(“6559514413705986049”)
}
}
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:534:17
assert.commandWorked@src/mongo/shell/assert.js:618:16
DB.prototype._runAggregate@src/mongo/shell/db.js:260:9
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1062:12

Anyone know of a way out?

Nevermind, found the issue. “F” in $addFields should be uppercase.

Thanks.

Glad you figured it out!