A classical relational database would have a field like USER_ID which would typically be an auto incrementing number. MongoDB has a document id which look something like the following
4f90e98277f6426c0a000001
Can this completely replace USER_ID? I guess what I’m basically asking is, in terms of searching, inserting and indexing is it just as fast as an auto incrementing number? If
It is unlikely that you’ll face performance issues because of primary key being ObjectID rather than an integer. You’ll sooner be affected by data size. I wouldn’t worry about that.
ObjectID brings several benefits:
created_atfield if you only want to sort by insertion time);