Add unique constraint on a field in multiple collections in MongoDB

124 Views Asked by At

I am having 3 collections, say A, B, C. In all 3 collections I have a field for email which is unique in respective collections. But now what I need is that email should be unique through out the database.

How can this be achieved?

I am using sails 0.12 and sails-waterline as ORM.

0

There are 0 best solutions below