Skip to content

Instantly share code, notes, and snippets.

@monyskynet
Created July 26, 2013 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monyskynet/6085458 to your computer and use it in GitHub Desktop.
Save monyskynet/6085458 to your computer and use it in GitHub Desktop.
In Query
var array = new List<int>() {3, 4};
var query = Query.All("SomeArray", BsonArray.Create(array));
collection.Find(query);
//The result of Query.All will all documents thats have nested array SomeArray with values 3 and 4.
//If you want 3 or 4 use
Query.In("SomeArray", BsonArray.Create(array))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment