Lab 4.2: Aggregation Performance

I have provided solution as
1st attempt, db.restaurants.createIndex( { stars: 1,stars: 1 } ) - > accidental copy paste
2nd attempt db.restaurants.createIndex( { stars: 1 } )
3rd attempt db.restaurants.createIndex( { stars: 1,cuisine: 1 } )

All answers failed. But if I see answer explanation it is same as mine.

A simple misunderstanding of what was expected as the answer.

In all of your attempts you entered the command you ran rather than the index.

The lab instructions mention:

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

For example, if you ran:

db.restaurants.createIndex( { foobar: 1 } )

to create the index that fixes the error, then you would enter the following document which lists the fields indexed into the text box:

{ foobar: 1 }

1 Like

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