Chapter 4: Advanced Crud Operations

Lab 3: Comparison Operators:

Issue: Typographical Error

Here are the instructions for the lab:

To complete this exercise connect to your Atlas cluster using the in-browser IDE space at the end of this chapter.
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?

Here is the fourth of four queries, which is designed to return all routes that have less than 10 stops in them.

db.routes.find({ "stops": { "$lt": 10 

But here is what the explanation claims should happen.

This is incorrect.
There is no way to have less than zero stops for a flight, so this query
yields zero results and asks for impossible information.

Yet here is a direct copy of the query in question with the first of numerous results being returned.

db.routes.find({ "stops": { "$lt": 10 }}).pretty()
        "_id" : ObjectId("56e9b39b732b6122f877fa31"),
        "airline" : {
                "id" : 410,
                "name" : "Aerocondor",
                "alias" : "2B",
                "iata" : "ARD"
        "src_airport" : "CEK",
        "dst_airport" : "KZN",
        "codeshare" : "",
        "stops" : 0,
        "airplane" : "CR2"

Unfortunately due to this issue, I was marked incorrect for this lab and now cannot achieve a higher score. Hopefully, this can help others to know before they make the same mistake.

Hi @killSh0t_13 ,

Thanks for sharing your thoughts. We are aware of this issue and our team is currently working on this for the resolution of the issue.

This particular lab has unlimited attempts that means you can submit your response as many times as you need to.

~ Shubham

1 Like

Thank you for the update, @Shubham_Ranjan! I understand that such bugs are sometimes difficult to iron out, and I appreciate the effort toward developing a fix.

1 Like