Lab: Array Operators and Projection
Problem:
To complete this exercise connect to your Atlas cluster using the in-browser IDE space at the end of this chapter.
How many companies in the sample_training.companies collection have offices in the city of Seattle?
Copy/paste your answer to the response field.
In this lab, I am looking for element “seattle” in “tag_list”, so my code is:
db.companies.find( { “tag_list”: { “$elemMatch”: { “tag_list”: “seattle” }}}).count()
But it returns result as 0.
I have no idea why I am wrong, could someone tell me plz? I