title: Querying array of arrays in MongoDB
body: <p>I have a mongo collection which has an array of arrays (bigrams from a NLP process) that I'd like to be able to search, so for example;</p>
  
  <pre><code>{
      "sentence" : "will most likely be",
      "biGrams" : [["will","most"], ["most","likely"], ["likely", "be"]
  },
  {
      "sentence" : "likely most people use stackoverflow",
      "biGrams" : [["likely","most"], ["most","people"], ["people", "use"], ["use", "stackoverflow"]
  }
  </code></pre>
  
  <p>What I'd like to be able to do is search through the biGram sub-doucment for a certain instance of one of these bigrams, e.g. search for all sentences that contain the bigram ["most","likely"].</p>
  
  <p>I've tried this;</p>
  
  <pre><code>find({'biGrams':{$elemMatch: {$elemMatch:{$in:['most','likely']}} }})
  </code></pre>
  
  <p>But this obviously finds all cases with the word 'most' or 'likely' are present. And the order is important, i.e. I don't want to find docs with ['likely','most'] in this example.</p>
  
  <p>Thanks in advance, I'm stumped....</p>