i am designing a database for storing chat history of a user in which sender and receiver can't be same person.so document should be like this 
`{sender :1 ,receiver:2}` but if a user insert a document `{sender :1,receiver :1}` then it should give an error.How to acheive this on javascript console.please guideline.i am designing database in mongodb.