Chapter 4 Lab 3: Comparison Operators

The result is true for the question: Using the sample_training.routes collection find out which of the following statements will return ONLY routes that have at least one stop in them?
But not for: Using the sample_training.routes collection find out which of the following statements will return ALL routes that have at least one stop in them?
Because query db.routes.find({ “stops”: { “$gte”: 0 }}).pretty() returns exactly ALL routes that have at least one stop in them and also routes without any stops.

Hi @Gennady_Tabala, welcome to the community. :wave:
As mentioned in the question, you need to find:

This implies that ALL the routes that have less than 1 stop should NOT be counted in the final result. Replacing the all with only is not going to make any difference here.

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

1 Like

In my opinion, the word “only” does not provide ambiguity in this case. So if you think the word “only” has the same meaning, I would recommend using it.
Kind regards.
Gennady Tabala.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.