title: MongoDB exception: WiredTigerIndex::insert: key too large to index
body: <p>I have a MongoDB collection.</p>
  
  <p>I want to change the indexing, to have a dual index, rather than a single.</p>
  
  <p>So I ran:</p>
  
  <pre><code>db.allnews.ensureIndex( { "url": 1, "source": 1 }, { unique: true } )
  </code></pre>
  
  <p>But then I get the error:</p>
  
  <pre><code>exception: WiredTigerIndex::insert: key too large to index
  </code></pre>
  
  <p>And the limit is 1024 bytes</p>
  
  <p>So what is the solution...?</p>
  
  <p>(1) Ignore it somehow.. somehow skip these records that are too long, without stopping the entire process..? </p>
  
  <pre><code>--setParameter failIndexKeyTooLong=false
  </code></pre>
  
  <p>?? Could this do the trick..?</p>
  
  <p>(2) Find the records that are too long, through some sort of query, and shorten them..?</p>
  
  <p>(3) Something else..?</p>