You can check unique indexes in mongoDb. This ensures that the indexed fields do not store duplicate values. This is the link