I realized that we had to use the $elemMatch operator to find the correct answer, but I was thinking of another way to find it. I thought, what if I saved the count of how many documents have a value that matches the criteria per array index position. In this case, results only has 3 positions: 0,1,2. So if I simply found the total of each document where each index position of the array meets the criteria of being greater than or equal to 70 and less than 80 I should get the correct answer right?
So I saved them in three different values, added them up and got 762. This is assuming that the question is asking to find how many documents hold a value in the results array where at least ONE of the values is both greater than or equal to 70 AND less than 80.
Why does my solution not work?
Attached is a screenshot that shows what I did:
Also, how can I query a specific index of an array? I tried querying specific index positions to try to figure out why I am wrong and I got these results: