I
I
IDONTSUDO2019-10-22 09:48:28
MongoDB
IDONTSUDO, 2019-10-22 09:48:28

Does _id in Mongo Db always have the same number of characters?

Does the _id of a document in mongo always have the same number of characters?
PS

spoiler

It seems to me that it seems like a quantity, the symbol for each document is the same. But I'm implementing it right now, a feature. And in general. I don't want to redo it later.
7 troubles one answer, insert the crutch to reinvent the wheel

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hzzzzl, 2019-10-22
@IDONTSUDO

default yes, because it is prescribed as it was said above,
but no one forbids writing your own at least 1, 2, 3, sdfsfsf, sdf34f2343fd , the main thing is to be unique

db.my_database.insert({_id:"this_is_super_unique_id_value", a:1, b:1})

F
Frozen Coder, 2019-10-22
@frozen_coder

Did you open the documentation ?
Well, no one bothers you to use uuid instead of ObjectId.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question