Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript User Authentication With Express and Mongo User Registration Storing Passwords Securely

My app says it is connected to the default port and I switched to it in Mongo Shell but no users data listed where is it

I am trying to find out where my data is being saved and I can not see it on the cloud or in the mongo shell. When I do db.es-app.find() it states [js] ReferenceError: app is not defined : @(shell):1:1.

Please help.

Thanks

1 Answer

Eric M
Eric M
11,546 Points

Hi SK,

I think we'll need a lot more information to help you debug this.

If you post the code that your app uses to connect to the DB and write data to a collection, as well as the commands you use in Mongo shell from connecting to db.es-app.find() it will be easier to help you debug.

When posting code be sure to enclose it in three backticks (`) with the language specified after the header backticks. This will make your code easier to read and thus easier to debug.

e.g.

```JS

displayNumbers = JSON.parse(localStorage.getItem('numbers')) for (let num of Object.values(displayNumbers)) { console.log(num) }

```

becomes

displayNumbers = JSON.parse(localStorage.getItem('numbers'))
for (let num of Object.values(displayNumbers)) 
{
    console.log(num)
}

Cheers,

Eric