LAB 4.2 - Any hints

Hello all,

This seemed a pretty straight forward question:

  • group stage does not use index
  • sort and match stage involve stars only so create an index on stars
  • index should be ascending in nature
  • since the question states “we’re looking for an index as small as possible that services this command”, I immediately think think about a partial index.

So therefore my idea is (as the same is mentioned already elsewhere I thought I mention it:)

Given the format of the answer required, I would just include the json within the parenthesis, like {…}, {…}

Dont get me wrong I am not really after an answer so I can pass this test - its just that I am really intrigued why this is wrong. Any hints would be appreciated.

Yes the format is correct
Need to review if your still failed

@ Henk_81354

In this case, “smallest” does not mean the index that uses the least disk space, but the index that uses the least number of elements. The issue here is that there are multiple possible indexes which will all service the query and eliminate the error message Notice the part of the problem statement that indicates

Keep in mind that there might be several indexes that resolve this error, but we're looking for an index as small as possible that services this command.

In the text box below, submit the index that resolves the issue.

For example, if you ran db.restaurants.createIndex({ foobar: 1 }) to fix the error, then you'd enter { foobar: 1 } into the text box.

Use that as your example and I think you’ll get the correct answer.

Wow, this is exactly where I got wrong then - I thought about disk space without a shed of a doubt…
Thank you, very much appreciated!


So I am in the same boat as Henk thinking of index disk space size with the wording in the question but you are telling me “smallest” meaning the actual length of the text of the index creation command is what they were looking for!!!


Thanks for clarifying DHz cause I have been thinking why my answer was wrong for a few days now.

Yep, to be honest I think the question needs tweaking as it’s not exactly clear what is required here.

1 Like

@ Henk_81354

While this group of students is the first to have this issue, I agree. I have posted an update to the curriculum team on this, but I would encourage all of you to report it – using the “Report an issue” tab at the bottom of the screen – as well, as student reports are very much valued and taken into account.

I can certainly see why this can be confusing. :thinking:

Hi, thanks for your understanding.
I reported this as an issue.
Kind regards,