How to add schema to check uniqueness of a field?

I have a collection in which to store texts. I need to eliminate adding to the collection of texts with identical titles. What changes you need to make in the scheme?
A similar situation with a collection of authors. The object the author has a key publication with an array of articles. How to prevent re-added to the array of information about the articles that were added earlier?
March 20th 20 at 11:46
0 answer

Find more questions by tags MongoDBMongoose