Get request returns empty array

Hi all!

I am stuck with this problem and hope someone knows the anwser :slight_smile:
I am trying to run a get request endpoint but it keeps returning an empty array.

here is my code if someone wants to take a look.

Live project: https://ulysses-mongo-api.herokuapp.com/

Hi Ulysses

Have you checked there is actually data loaded into your collection?
I have run multiple queries but nothing is returned for either all books or a specific book?

Hi mba_cat

I have a data loaded into the collcection that is why it is so confusing

Hi Ulysses

Your screenshot is of the json file in the repository - has this data actually been loaded into your database?

From the code there are a number of process.env variables that need to be set to load the data, these may not be set hence why I asked if the data has actually been loaded into the database.

Can you check if your mongo cluster has the data from the json loaded into it.

1 Like