How to add a primary key to a specific column in MongoDB?
How to avoid duplicate records in MongoDB?
How to add a primary key to a specific column in MongoDB?
How to avoid duplicate records in MongoDB?
create a unique index on the field https://docs.mongodb.com/manual/core/index-unique/
_id is the default reserved id for the mongodb object and that's an unique id. refer that link it will help you to get the idea of unique id http://www.mongodb.org/display/DOCS/BSON