# MongoDB findOne() Returning Weird Object - Can Someone Interpret It?

**URL:** <https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665>\
**Category:** General\
**Created:** [August 1, 2019, 11:33pm UTC](https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665 "2019-08-01T23:33:44Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![eoja](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/eoja/32/135387_2.png) [@eoja](https://forum.freecodecamp.org/u/eoja)\
**Post date:** [August 2, 2019, 5:18am UTC](https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665/21 "2019-08-02T05:18:55Z")

</div>

OP is originally dealing with a POST method not a GET method. Are you referring to the issue tracker project rather than the url shortener project?

EDIT, I understand what you are saying.

---

<div class="post-metadata">

**Author:** ![willjw3](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/willjw3/32/196790_2.png) [@willjw3](https://forum.freecodecamp.org/u/willjw3)\
**Post date:** [August 2, 2019, 12:28pm UTC](https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665/22 "2019-08-02T12:28:05Z")

</div>

The original question was about what the `findOne()` method returned. This is a Mongoose method that is independent of the type of method used in Express, whether that’s a `GET` method or a `POST` method. Also, it’s independent of whether or not we’re dealing with the ‘Issue Tracker’ project or the ‘URL Shortener’ project. You could use the `findOne()` method (or other Mongoose query method) to find whether or not a document exists in the database, either in an express POST method or GET method. For example, say you wanted to register a new user using a POST method, you could first check the database to see if a user with a certain email address was already registered or not before creating a new user document.

---

<div class="post-metadata">

**Author:** ![willjw3](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/willjw3/32/196790_2.png) [@willjw3](https://forum.freecodecamp.org/u/willjw3)\
**Post date:** [August 2, 2019, 12:33pm UTC](https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665/23 "2019-08-02T12:33:56Z")

</div>

Basically, yes. I would suggest using `async/await` because it is simpler and it allows you to store the result of the database document query to a variable and use it later within your Express method (GET, POST or otherwise).

Keep up the good work. You’re almost finished with the certificate!

---

<div class="post-metadata">

**Author:** ![Vardhman](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/vardhman/32/153809_2.png) [@Vardhman](https://forum.freecodecamp.org/u/Vardhman)\
**Post date:** [June 12, 2020, 3:58pm UTC](https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665/25 "2020-06-12T15:58:18Z")

</div>

I have the same problem  
when I had gone through my code I found that I had not imported the connection file in my index.js file  
so mongoose return the object of my query base on my model schema

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 11:27am UTC](https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665/26 "2021-01-16T11:27:12Z")

</div>

Closed on January 16, 2021, 11:27am UTC



[Previous page](https://forum.freecodecamp.org/t/mongodb-findone-returning-weird-object-can-someone-interpret-it/300665.md?page=1)
