M001: unable to use $project on atlas m0 tier

Hi everyone,

I’m using the m0 Atlas cluster to complete the lab assignments from the M001 course, as suggested by the course itself. I’m on chapter 5, and the $project keyword is not allowed, therefore I cannot continue using the Atlas cluster alone.
Is there something I forgot to enable?

Example:

MongoDB Enterprise atlas-yfcyek-shard-0:PRIMARY> db.listingsAndReviews.aggregate([
… { “$project:”: {“room_type”: 1, “_id”: 0}},
… { “$group”: { “_id”: “$room_type”}},
… ])
2021-04-20T06:12:25.943+0000 E QUERY [js] Error: command failed: {
“ok” : 0,
“errmsg” : “$project: is not allowed in this atlas tier”,
“code” : 8000,
“codeName” : “AtlasError”
} : 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
@(shell):1:1

Hi @Salvatore_Merone, welcome to the community.
As we can see from the aggregation query you posted above, it looks like you have a typo in your query, i.e., it should be “$project” instead of “$project:”. We hope it helps.

In case you have any doubts, please feel free to reach out to us.

Thanks. Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

2 Likes

Thank you very much @SourabhBagrecha, it was indeed a nasty typo!