title: "unknown top level operator: $OR" error in Mongodb
body: <p>I tried to run this query to get the count of PostGraduate and Graduate document.
  I am getting the error : &quot;errmsg&quot; : &quot;unknown top level operator: $OR&quot;
  Please let me know what is the mistake here.</p>
  <pre><code>db.collection.aggregate(
  [
  { &quot;$match&quot;: { &quot;$OR&quot;: 
  [{Education: &quot;Graduate&quot;}, {Education: &quot;PostGraduate&quot;}] 
  } },
  { $group: { _id: &quot;$Education&quot;,  TotalCount: { $sum: 1 } } }
  ]
  )
  </code></pre>
  <p>This is the collection:</p>
  <pre><code>{ Education: &quot;Graduate&quot; },
  { Education: &quot;Graduate&quot; },
  { Education: &quot;Graduate&quot; },
  { Education: &quot;PostGraduate&quot; },
  { Education: &quot;PostGraduate&quot; },
  { Education: &quot;UnderGraduate&quot; },
  { Education: &quot;UnderGraduate&quot; }
  </code></pre>