Answer the question
In order to leave comments, you need to log in
How to set your id to the user who will increase by 1?
How to create your own ID in the user model that would increase by one with each registration? At the moment, the built-in mongus ids have a very unpresentable look (60abf7055bd7c61cc0d6fb64), but I would like the id1, id2 and so
on
.
it is possible to add two types of treatment to one request?
//чтение юзера
router.get("/:id или ник юзера", async(req, res) => {
....
})
Answer the question
In order to leave comments, you need to log in
Could two types of appeal be added to one request?
router.get("/:idOrNickname", async(req, res) => {
// и делаете запрос ИЛИ подставляя req.params.idOrNickname как _id и nickname
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question