title: MongoDB linq C# select document where array of subdocumnets contain all values from string array
body: <p>I have a collection on MongoDb with a similar stricture to the object below. </p>
  
  <pre><code>{
      _id: ObjectId("0000000"),
      groupName: "Group A",
      users[
          {
              userId: "1111111",
              rollDescription: "Some Text Here"
          },
          {
              userId: "2222222",
              rollDescription: "Some Text Here"
          },
          {
              userId: "3333333",
              rollDescription: "Some Text Here"
          }
      ]
  }
  </code></pre>
  
  <p>Elsewhere in the system an array of "userIds" is generated and I need to select all groups that contain all userIds in the array. </p>
  
  <p>Is it possible to do this using just linq? </p>
  
  <p>I know I can use this if I had just an array of userIds:</p>
  
  <pre><code>from g in groups.AsQueryable&lt;Group&gt;() where g.Users.ContainsAll(usersIds.ToArray()) select g;
  </code></pre>
  
  <p>Is there something similar for querying an array of subdocumnets instead of an array of strings?  </p>