SyntaxFix
Write A Post
Hire A Developer
Questions
Simple you can use
db.collectionName.createIndex({urfield:1},{unique:true});