Aggregate not returning desired value (chapter 3)

I am running the group, sort and limit on the dataset but get told that there should be more results than I am actually getting:

Expected value to equal:
  {"_id": "", "count": 909}
  {"_id": "", "count": 488}

I did assume the issue was with the readConcern. I opened up a shell and ran the query manually with all possible values but I keep getting the same answer. Here is my query (level: ‘majority’} in the query is an example. I have tried all possible values and also without the readConern option):

MongoDB Enterprise mflix-shard-0:PRIMARY> db.comments.aggregate([{ $group: { _id: “$email”, count: { $sum: 1 } } }, { $sort: { count: -1 } }, { $limit: 20 }], {readConcern: {level: ‘majority’}})

Not sure what I’m doing wrong or where to go from here. Any help much appreciated.


Hi @Andrew_76576,

You have placed the readConcern in the wrong place. Check out this link to see if you can spot the hint on how to create and place your variable:

Hope that this helps before it’s too late. :smile:

Despite the other comment this has nothing to do with readConcern.

Instead see Ticket X fails but I’m sure my implementation is correct! because the problem will be with your data, which you should re-load.

Also note that the “User report” ticket from chapter 3 is past the deadline, so the show answer link on the page will give you the correct implementation details anyway.