How do you implement an auto-incrementing primary ID in MongoDB?

后端 未结 7 1600
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 12:11

Just like in MYSQL, I want an incrementing ID.

7条回答
  •  余生分开走
    2020-12-05 12:43

    MongoDB is intended to be scaled horizantally. In this case, an auto increment would lead to id collisions. That is why the id looks much more like a guid/uuid.

提交回复
热议问题