Make sure that two documents cannot contain the same value in the given field.

db.collection.ensureIndex({ field : 1 })