There are few typos in commands listed in Mongodb cheat sheet available at MongoDB Courses and Trainings | MongoDB University which results in errors and needs correction, I tried to find a way to report the issues directly to support from chat and contact page but that didn’t work.
Particularly in page 8 and 9 near $group open bracket is used which should be open curly braces instead, this typo repeats multiple time in commands on same pages:
Here is an Example:
Problem:
db.orders.aggregate([{$group:(_id:null,count:{$sum:1}}}])
Uncaught:
SyntaxError: Unexpected token, expected "," (1:33)
> 1 | db.orders.aggregate([{$group:(_id:null,count:{$sum:1}}}])
| ^
2 |
Correction:
db.orders.aggregate([{$group:{_id:null,count:{$sum:1}}}])
[ { _id: null, count: 1 } ]