M
M
monkay2021-04-25 19:39:14
MongoDB
monkay, 2021-04-25 19:39:14

How to create user IDs in mongodb?

Hello!
I am an eggplant in this area, so I wanted to ask you, maybe the question will sound stupid for many ... But I don’t know how to make it so that when a person registers, he is given an ID. For example, the first person registered and he was given 1ID, and so Further. Thanks in advance.
All good.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Pautov, 2021-04-25
@bootd

The mong already has an id for the entry, the field is _id . Otherwise, how to get records?

A
Alexey Yarkov, 2021-04-25
@yarkov

https://github.com/TheRoSS/mongodb-autoincrement

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question