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 Using SQL ORMs with Node.js Performing CRUD Operations Retrieve Records

findAll() with one result still needs an array method

Less a question and more of an observation.

I quickly copy-pasted a findAll() search but only had one person. So I kept my console.log(people.toJSON()) and wondered why I received an error.

Of course, even though there is only one result in my case, the results (unless NULL I assume) will still come in an array so need to be treated as such.

It makes sense and probably was obvious to most but I overlooked it so thought I would share.

1 Answer