title: Assistance with some MongoDB queries
body: <p>I have this item structure (C#):</p>
  
  <pre><code>event2 = new EventItem
                  {
                      type = "Warning",
                      date = DateTime.Now.AddHours(i * (-1.5)),//in a seed loop
                      serverGroupId = "507f1f77bcf86cd799439012",
                      serverLocalId = "507f1f77bcf86cd799429015",
                      system = "Authentication server",
                      message = "User has logged in from another IP.",
                      messageAttributes = new AttributeItem[] { new AttributeItem { param = "userId", value = "789efe77bcf86cd799439013" },
                                                                  new AttributeItem { param = "component", value = "server" }},
                      warningLevel = 4
                  };
  </code></pre>
  
  <p>I want to find the most frequent component that a log is about, which has occurred in the last 24 hours and is of type warning or error. So far I have written the query that gives me all logs within 24 hours that are of type error or warning, but I am having trouble with the part with the most frequent component:</p>
  
  <pre><code>var results = collection.Find(Query.And
                  (
                      Query.Or
                      (
                          Query.EQ("type", "Warning"),
                          Query.EQ("type", "Error")
                      ),
                      Query.GT("date", DateTime.Now.AddDays(-1)),
                      Query.LT("date", DateTime.Now)
                  )
              );
  </code></pre>
  
  <p>What do I need to add to get the most frequent component (and possibly the number of logs with that component within the last 24 hours)?</p>