April 2020
Intermediate to advanced
716 pages
18h 55m
English
We can see whether a new user is in the database by fetching a list of all users with a GET request to /api/users. The response should contain an array of all the user objects stored in the database:

Notice how the returned user objects only show the _id, name, email, and created field values, and not the salt or hashed_password values, which are also present in the actual documents stored in the database. The request only retrieves the selected fields we specified in the Mongoose find query that we made in the list controller method. This omission is also in place when fetching a single user.
Read now
Unlock full access