Search code examples
databaseapirestexport

Issue with an REST API- suggestions to my problem


So I started a REST API, it is part of an exercise. Anyhow, I wanted to ask to the community what would you do if your request tested through Postman sent responses as null or an empty array. I use the mongo shell and it shows me there are two collections within my db. I am confused and have not really found an answer.

Ex: this is what the cmd responds

::1 - - [16/Nov/2022:11:04:14 +0000] "GET /movies HTTP/1.1" 201 2 or ::1 - - [16/Nov/2022:11:07:13 +0000] "GET /movies/The%20Lord%20of%20Rings:%20The%20Fellowship%20of%20the%20Ring HTTP/1.1" 200 4.

I have gone through the instructions and I do not see an error so to speak in the index file as well as the model.


Solution

  • It’s probably an error in your GET function. No reason to have a different behaviour between MongoDB localhost & MongoDB in Atlas unless you are using completely different versions.

    Maybe share the code and someone can help debug https://community.postman.com/t/tests-for-empty-response-body/15584