title: Mapping multiple sources of data with different field names for mongodb and mongoose (nodejs)
body: <p>I am working on a website that will house a bunch of data from different sources. The sources may have much of the same data (there is some redundancy), but the fields in the json may vary here and there. These sources are from REST API's, all json.</p>
  
  <p>My question is, how can I map these different sources using mongoose schemas? I want it to be as easy as possible, like some kind of table where I just need to add the field name of the new source, and what field it maps to in my database. I am using express/node. </p>
  
  <p>Here's an example of two sources, and my schema spec.</p>
  
  <p>Eg. </p>
  
  <p>First source:</p>
  
  <pre><code>{
      "address":"123 abc st"
  }
  </code></pre>
  
  <p>Second source:</p>
  
  <pre><code>{
      "addr":"123 abc st"
  }
  </code></pre>
  
  <p>My Schema:</p>
  
  <pre><code>{
      address:{
          type: String,
          required: true
  }
  </code></pre>