title: Unique together only if both values are present
body: <p>I have a schema like this</p>
  
  <pre><code>const appSchema = new mongoose.Schema({
   email: String,
   appId: {
     type: String,
     required: true
   }
  })
  </code></pre>
  
  <p>I have made it unique together with <code>appUserSchema.index({ email: 1, appId: 1}, { unique: true, sparse: true });</code>.</p>
  
  <p>What should I do if I want multiple <code>email</code> to be empty (anonymous users)? Currently I can have only one entry with <code>email</code> empty because of the above constraint.</p>