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 trialNeil Anuskiewicz
11,007 Pointsquestion about MEAN output
Hi, I'm working on the todo list project for the MEAN course, and get this output when I run Get via Postman on http://localhost:3000/api/todos/ This output doesn't look right so I think there must be a problem somewhere. Any ideas on where to start my efforts to debug this or even the best way to narrow down the problem? Here's the get output: { "todos": [ { "id": "571996b1cb30e1ba23f9196c", "v": 0 }, { "_id": "571996c8cb30e1ba23f9196d", "v": 0 }, { "_id": "571996c8cb30e1ba23f9196e", "v": 0 }, { "_id": "571996c9cb30e1ba23f9196f", "v": 0 }, { "_id": "571996cacb30e1ba23f91970", "v": 0 }, { "_id": "571996cacb30e1ba23f91971", "v": 0 }, { "_id": "571996cbcb30e1ba23f91972", "v": 0 }, { "_id": "571996cccb30e1ba23f91973", "v": 0 }, { "_id": "57199712cb30e1ba23f91974", "v": 0 }, { "_id": "57199717cb30e1ba23f91975", "v": 0 }, { "_id": "57199718cb30e1ba23f91976", "v": 0 }, { "_id": "57199719cb30e1ba23f91977", "v": 0 }, { "_id": "57199719cb30e1ba23f91978", "v": 0 }, { "_id": "5719971acb30e1ba23f91979", "v": 0 }, { "_id": "5719971acb30e1ba23f9197a", "v": 0 }, { "_id": "571ab20dfda20a8f0feb688a", "v": 0 }, { "_id": "571ab22efda20a8f0feb688b", "v": 0 }, { "_id": "571ab238fda20a8f0feb688c", "v": 0 }, { "_id": "571ab4732930d494125c3020", "v": 0 }, { "_id": "571ab48a2930d494125c3021", "v": 0 }, { "_id": "571ab4942930d494125c3022", "v": 0 }, { "_id": "571ab49c2930d494125c3023", "v": 0 }, { "_id": "571ab4b32930d494125c3024", "v": 0 }, { "_id": "571ab4ba2930d494125c3025", "_v": 0 } ] }
1 Answer
Seth Kroger
56,413 PointsI'm not sure exactly where you are in the course, but it looks like the the records you're getting back are essentially empty. This could be any number of things like 1. The angular end isn't sending the data correctly when you create a new todo 2. The post route to create todos isn't reading the data correctly. 3. You're restricting the properties to send back when you list the todos, and aren't sending the right ones.
I'd start with the mongo shell to check that the fields are blank in the actual database (eliminating 3) and then check the post requests for a new todo in the app with Dev Tools to narrow down where the error is.