I can post to my database, but my get requests say that my database is empty on Postman

I’m building a basic CRUD application using MongoDB atlas as my database. Using Postman, I’m able to send post requests and I can see that they are posting correctly because I see my document in there. (and I’m getting a http 201 created response


But when I try to do a simple get response that is supposed to return all of my data, postman is returning nothing. Just an empty array.

I tried looking online on youtube videos for help through tutorials, but all my code looks pretty parallel. Only main difference is that most tutorials use just mongoDB locally, not the atlas cloud version. But I dont think it would make much of a difference in code, especially since I am able to successfully do a post request

Hi @James_Villamayor and welcome in the MongoDB Community :muscle: !

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.


My bet is that you are missing the default constructor in your POJO but I could be wrong.

Check out my equivalent starter project where I’m using Spring boot but not Spring Data (because it’s a useless proxy to the MongoDB driver in my opinion)

I may have related problem. The problem is with my search api
When i queried directly on my db on atlas/compass, i got the result i wanted.

But when i used postman or search on my web, the result contains all my documents and the web got crashed.
Here is my code

            full_name: { $regex: new RegExp('.*' + player_name + '.*', 'i') },
        }).sort({ rating: -1 })
            .then(players => {
                // console.log(players)

Please help me!
Thanks in advanced