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 dataset were
either founded in 2004
- [and] either have the social category_code [or] web category_code,
[or] were founded in the month of October
- [and] also either have the social category_code [or] web category_code?
Copy/paste the exact numeric value (without double quotes) of the result that you get into the response field.
My Question
I am not able to find out why the below query gives me the wrong result. And also the below query runs in Atlas but throws a syntax error if I run it in the MongoDB shell with the db.companies.find()
{"$or":[ {"$and": [ {“founded_year”:2004},{"$or":[ {"category_code":"web"},{"category_code":"social"}] }]} ,{"$and": [{"founded_month":10},{"$or":[ {"category_code":"web"},{"category_code":"social"}] }]}]}
Thanks