Ticket - Delete Comments: Unable to retrieve movie comments

I am getting the following error when working with the delete comment ticket, my test cases all pass.

Y:\M202>npm test -t delete-comments

> server@1.0.0 test Y:\M202
> jest --passWithNoTests "delete-comments"

Determining test suites to run...Setup Mongo Connection
 PASS  test/delete-comments.test.js
  Delete Comments
    √ Can post a comment (237ms)
    √ Cannot delete a comment if email does not match (40ms)
    √ Can delete a comment if email matches (38ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        3.441s
Ran all test suites matching /delete-comments/i.
Teardown Mongo Connection

The status page:

The db filter:

The data in the db is there, i can’t seem to find what the problem is, can somebody assist me?

Do you sort the comments from the most recent to less recent in getMovie?

Same problem here.
Yes, comments are sorted descending.

Can we please avoid “I’m having this problem too” and similarly phrased comments.

If you have input to an actual solution, or are seeking clarification on an earlier statement then by all means write in your input. But if you simply are interested in seeing if any such updates are made by someone else leaving such information, then you watch the topic in order to be notified.

You can watch by clicking the button on the right side of the screen, which is basically the one right next to the reply button and directly under the scroller for the thread. You will see when someone makes any addition to the topic with this option.

Simply stating that you too are having the same problem really does not resolve anything, nor is anyone responding obligated to individually answer everyone who has done so. So the basic request is to keep posts to direct Questions, Answers or requests for clarification.


As for the question on the ticket itself, the specific error "Unable to retrieve movie comments" comes from the simple testing that there is at least one “comment” to be retrieved for a specific movie at that the returned “comment” has an _id property. You don’t get this message outside of those two cases.

The pointer here would be that either:

  1. The data is incorrect, and there are earlier threads on differing results from status page that point you to running mongorestore again.

  2. Your getMovieByID() is still not implemented correctly, even if it managed to pass a unit test and the test done for the status page.

In the case of 2 it would be best advised you acutally check the suggested solution from that ticket after you subitted the verification code, and ensure that both are indeed the same. Otherwise fallback to 1 and restore the data.

1 Like

I restored the data, and it worked. Thanks.

hello, can you be a bit more specific about how you restored the data?

Are you sure your data has been corrupted?

If you are using the Atlas cluster and you are concerned that you data in the sample movies collection has been corrupted.

Then delete all the sample collections and reload the collections as you did initially when you setup.

thanks, I have no real indication of data corruption, perhaps it’s just a case of need to update the Node.JS and/or the Mongo installs.
I just notticed that mongorestore needs the mongoTools to run.

Loading the sample dataset is probably the last resort, since I will then need to restore all my tickets code.