title: Increasing MongoDB performance on multiple array fields
body: <p>I have a large MongoDb collection, where users can search on multiple Array fields. How is the best way to index that? I saw that creating indexes for multiple Array indexes ends up with:</p>
  
  <p><strong>"Mongo::Error::OperationFailure: cannot index parallel arrays"</strong></p>
  
  <p>Example query: </p>
  
  <pre><code>db.collection.find(
     {category_ids: {$in: [object_id, object_id]}, 
      second_category_ids: $in: {[object_id, object_id]}
     }
  )
  </code></pre>