This is the function generating your collection documents _id
s
It uses if available either
$objId = new \MongoDB\BSON\ObjectId();
(which is what MongoDB normally uses for their _id
s https://docs.mongodb.com/manual/core/index-unique/; see also Generating Globally Unique Identifiers for Use with MongoDB | MongoDB Blog )
or a “mongo db like id”, based on
- the timestamp in ms
- a “random” 5 char integer
- a “random” 2-3 char integer
binaried, hashed and hexed.
Both seem to be setup to create a very unique ID in forever UNLESS you generate
- MongoDB: > 16million items within 1 second ( https://betterprogramming.pub/is-the-id-property-in-mongodb-100-unique-f1eaa19522ba#dd87 )
- MongoLike: > 88million items at the same microsecond (?*)
*) 89000 * 990 ~ 88mill