title: MongooseJS populate using multiple target fields
body: <p>I have the following two Schemas:</p>
  
  <pre><code>var MessageModel = mongoose.model("message",
      new Schema({
          sender:{type:ObjectId,ref:"user"},
          recipient:{type:ObjectId,ref:"user"},
          title: String
      })
  );
  
  var UserModel = mongoose.model("user", 
      new Schema({
          username: String,
          name: String,
          fname: String,
          messages:[{type:ObjectId,ref:"message"}]
      })
  );
  </code></pre>
  
  <p>What I can't find anywhere is how does mongoose determine where to get the 'message' populating from - the 'sender' field or 'recipient' field...</p>
  
  <p>Is it one? both? Can this be configured?
  i.e. can I create separate 'incomingMessage' and 'outgoingMessages' fields and how?</p>
  
  <p>10x.</p>