title: M2M links in CouchDB with non-primary keys
body: <p>I have a bunch of "meeting" documents and a bunch "user" documents. A
  user may have multiple emails and a meeting may be between multiple
  people identified by emails.</p>
  
  <p>I need to lookup users by meeting ID and meeting by user ID by way of
  the emails.</p>
  
  <p>My documents look like this right now:</p>
  
  <pre><code>{
    "type": "meeting"
    "_id": "MEETINGID",
    "emails": ["test1@example.com", "test2@example.com"]
    // Lots of others things
  }
  
  {
    "type": "user",
    "_id": "USERID",
    "emails": ["a@example.com", "test1@example.com"]
    // Lots of others things
  }
  </code></pre>
  
  <p>I need to keep them linked via email.</p>
  
  <p>But I could certainly split them out like this if it would help:</p>
  
  <pre><code>{
    "type": "user",
    "_id": "USERID",
    // Lots of others things
  }
  
  {
    "type": "user-email",
    "_id": "USERID",
    "email": "a@example.com"
  }
  
  {
    "type": "user-email",
    "_id": "USERID",
    "email": "test1@example.com"
  }
  </code></pre>
  
  <p>I need views that produce something like this:</p>
  
  <pre><code>{
    "key": "MEETING",
    "document": {"_id": "USERID"}
  }
  
  
  {
    "key": "USERID",
    "document": {"_id": "MEETINGID"}
  }
  </code></pre>
  
  <p>Is this going to be possible? I have a horrible feeling I'm going to
  be making load of queries to do this :(</p>