title: Removing an element from an array in MongoDB
body: <p>I am new to learning how to use MongoDB and am stuck pretty early on, so hoping someone can help me out with a simple example.</p>
  
  <p>I can successfully connect to a Mongo server and create a collection and create objects to put in it. I am doing all of this through c# and the c# driver.</p>
  
  <p>I have the following custom objects defined in my code.</p>
  
  <pre><code>public class Feature
  {
      public string FeatureName { get; set; }
      public ObjectId Id { get; set; }
      public List&lt;Scenario&gt; Scenarios { get; set; } 
  }
  
  public class Scenario
  {
      private string _notes;
      public string ScenarioName { get; set; }
      public List&lt;string&gt; Givens { get; set; }
      public List&lt;string&gt; Whens { get; set; }
      public List&lt;string&gt; Thens { get; set; }
      public string Explanation { get; set; }
      public string Notes { get; set; }
  }
  </code></pre>
  
  <p>As you can see, the Feature object contains a property which is a list of scenarios.</p>
  
  <p>In my Mongo collection I have a Feature object that contains 3 scenarios. What I want to do in C# is write a method that can remove a specific scenario from a feature:</p>
  
  <ol>
  <li>User provides a feature and scenario name to a method</li>
  <li>Method checks the feature, looking through the list within it, for a scenario where the scenario.scenarioname matches the scenario name passed in to the method</li>
  <li>If it exists, then remove the scenario from the feature and update Mongo and return a bool of true. If it doesn't exist return false</li>
  </ol>
  
  <p>I am sure that this is probably going to be obvious when I see an example, but I have tried and get stuck trying to work through the List property looking for a property on a sub object.</p>
  
  <p>I hope that all makes sense??!?</p>
  
  <p>Thanks in advance.</p>
  
  <p>P</p>