Answer the question
In order to leave comments, you need to log in
Why do models have strange IDs (hash)?
Hello. Please explain why my models have such strange IDs.
{myrecord,"myrecord-52a1dd5e4346e109ba000001",<<"123">>}
{myrecord,"myrecord-1",<<"123">>}
. Maybe there is some kind of base setting?
Answer the question
In order to leave comments, you need to log in
The fact is that the document id in the MongoDB database is a hash of a string formed by the concatenation of the computer name on which the process is running, the process number and a numeric counter. This kind of identifier provides a much greater uniqueness of the document. This is the method chosen by the MongoDB developers, you will have to put up with it) You can read more about it here: docs.mongodb.org/manual/reference/object-id
UPD: the current Timestamp is also included in the concatenation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question