Skip to content

Commit 7c4fea3

Browse files
Update part4c.md
Removed note regarding mongoose-unique-validator incompatibilty with Mongoose version 7. mongoose-unique-validator was updated at 11/04/2023 to the version 4.0.0 and is now compatible with Mongoose version 7.
1 parent 6497685 commit 7c4fea3

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/content/4/en/part4c.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,6 @@ userSchema.plugin(uniqueValidator) // highlight-line
379379
// ...
380380
```
381381

382-
Note: when installing the _mongoose-unique-validator_ library, you may encounter the following error message:
383-
384-
![](../../images/4/uniq.png)
385-
386-
The reason for this is that the library is not yet compatible with Mongoose version 7 at the time of writing (March 13, 2023). If you encounter an error, you can downgrade to an older version of Mongoose by running the command
387-
388-
```
389-
npm install mongoose@6
390-
```
391-
392-
After this, you can install the library _mongoose-unique-validator_ without problems.
393-
394382
We could also implement other validations into the user creation. We could check that the username is long enough, that the username only consists of permitted characters, or that the password is strong enough. Implementing these functionalities is left as an optional exercise.
395383

396384
Before we move onward, let's add an initial implementation of a route handler that returns all of the users in the database:

0 commit comments

Comments
 (0)