Here is the question to solve it
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 of the result that you get into the response field.
Summary
Here is the answer which I saw once my answer got failed
db.companies.find({ “$and”: [
{ “$or”: [ { “founded_year”: 2004 },
{ “founded_month”: 10 } ] },
{ “$or”: [ { “category_code”: “web” },
{ “category_code”: “social” }]}]}).count()
But I think, this is wrong query per problem. I would say, this would be the right query
Summary
db.companies.find({ “$and”: [
{ “founded_year”: 2004 },
{ “$or”: [{ “category_code”: “social” }, { “category_code”: “web” }, { “founded_month”: 10 }] },
{ “$or”: [{ “category_code”: “social” }, { “category_code”: “web” }] }
] }).count()
Any suggestion on this