The /status
link verificaton for this does not actually have very stringent tests that you actually implemented this correctly. As such I’m not going to say what the very easy way to fake a result here is, but it’s actually all too easy.
That you are getting different results to what the unit test expects is basically due to either of two options:
-
Aggregation pipeline implemented incorrectly.
-
Data has been corrupted or not imported properly.
In the case of 1. or just basically with the very fact you already got a verification code from the /status
page, you can simply compare your aggregation pipeline with the one which will now be available to you as a possible answer as this link becomes available once you submit the verification code.
In the case of 2, or indeed where you compared the pipelines but still get a different result, then your best bet is to download the handouts again, extract the /data
directory from within the mflix-js
folder and run the mongoimport
again. Ensuring to include the --drop
option so that all data is overwritten.
Note if you do “re-import”, you need to run the migration script again in order to get that test operating. But for “data only” restores, nothing in the other tests is effected as all changes for those are self contained.