title: Querying mongodb collection with subdocument array in sorted order
body: <p>I've following model structure:</p>
  
  <pre><code>Public Class WorksheetModel
  {
   [BsonId]
   [BsonRepresentation(BsonType.ObjectId)]
   public string Id { get; set; }
  
   public string WSName {get; set;}
  
   public string UserId {get; set;}
  
   public List&lt;QuizModel&gt; Quiz { get; set; } 
  }
  
  Public Class QuizModel
  {
   [BsonId]
   [BsonRepresentation(BsonType.ObjectId)]
   public string Id { get; set; }
  
   public string QuizName {get; set;}
  }
  </code></pre>
  
  <p>when I save, it produces structure in db something like this:</p>
  
  <pre><code>{
      "_id" : ObjectId("54a4e902bb63bc1370aff4a7"),
      "WSName" : "WS2",
      "UserId" : "54a4e902bb63bc1370aff5b9",
      "Quiz" : [
       {
        "_id" : null,
        "QuizName " : "Qz2"
       },
       {
        "_id" : null,
        "QuizName " : "Qz1"
       },
       {
        "_id" : null,
        "QuizName " : "Qz2"
       },
      ]
  },
  </code></pre>
  
  <p>I use following query to get worksheets list ordered by "WSName" </p>
  
  <pre><code>_collection = _db.GetCollection&lt;WorksheetModel&gt;("Worksheets");
  _query = Query&lt;WorksheetModel&gt;.Where( e =&gt; e.UserId == oModel.UserId);
  _cursor = _collection.Find(_query).SetSortOrder(SortBy.Ascending("WSName"));
  </code></pre>
  
  <p>But now I want to retrieve worksheets list in such a way where the subdocument array <strong>Quiz</strong> should also be <strong>ordered by QuizName</strong>.</p>
  
  <p>The final result should look like this:</p>
  
  <pre><code>{
          "_id" : ObjectId("54a4e902bb63bc1370aff4a7"),
          "WSName" : "WS1",
          "UserId" : "54a4e902bb63bc1370aff5b9",
          "Quiz" : [
           {
            "_id" : null,
            "QuizName " : "Qz1"
           },
           {
            "_id" : null,
            "QuizName " : "Qz2"
           },
           {
            "_id" : null,
            "QuizName " : "Qz2"
           },
          ]
      },
  {
          "_id" : ObjectId("54a4e902bb63bc1370aff4a7"),
          "WSName" : "WS2",
          "UserId" : "54a4e902bb63bc1370aff5b9",
          "Quiz" : [
           {
            "_id" : null,
            "QuizName " : "Qz4"
           },
           {
            "_id" : null,
            "QuizName " : "Qz4"
           },
           {
            "_id" : null,
            "QuizName " : "Qz5"
           },
          ]
      },
  </code></pre>
  
  <p>Now how should I query the document from C# so that I'll get above result.</p>