O'Reilly logo

Mongoose for Application Development by Simon Holmes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CRUD – reading user and project data

Now we're going to go through the main three static methods for a specific use case in our application. We'll also wrap one of these inside a custom static method that we are going to create.

findOne() – finding a single user

First up, let's add the ability for a returning user to log in. At this moment we are not using any type of authentication. This is intentional as there is a plethora of options out there for password hashing and encryption, using OAuth or social network accounts. While there are several node modules available to help with this, it will just prove a distraction while we're building the bare bones of our app. For now, while we're putting it together we'll stick to just entering an e-mail ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required