How to set a primary key in MongoDB?

前端 未结 9 991
再見小時候
再見小時候 2020-12-07 21:46

I want to set one of my fields as primary key. I am using MongoDB as my NoSQL.

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 22:14

    The other way is to create Indexes for your collection and make sure that they are unique.

    You can find more on the following link

    I actually find this pretty simple and easy to implement.

提交回复
热议问题