Create a unique field in mongodb

Hi @mmahdi. Welcome to the community.

You need a unique index on that field, just like _id, which is automatically assigned a unique index during collection creation.