How do I use in $in operator using the 2.0 version of the C# mongodb driver?
I found a lot of examples of how do use $in in the previous mongodb c# driver, but I can not find any examples on how to do it in the 2.0 version.
Use the AnyIn operator for the typed version: Builders<TDocument>.Filter.AnyIn(x => x.Array,searchArray)
I was able to figure it out. Here is how to define the Bson document for the Find method: BsonDocument bson = new BsonDocument("_id", new BsonDocument("$in", new BsonArray(vins)));
Or, how about this var ft = new BsonDocument("ListOfString", new BsonDocument("$in", varString)); var result = myContext.myPOCO.Find(ft);
MongoDB C# driver throws timeout exception when trying to connect to replica set
Serialize Dictionary<long, VALUE> to BSON documents
Using a Regex against a simple list with `ElemMatch` in MongoDB .NET
projection wont work in mongodb c# driver
BsonClassMapSerializer already registered for AbstractClassSerializer
MongoDb C# Driver 2.0 Coalesce (or equivalent)?
MongoDB dynamic update of collection when changes occurs in another collection
MongoDB C# 2.0 TimeoutException
MongoDB C# 2.0 upgrade
Searching a MongoDB collection from the end (c#)
Handle extra elements outside of deserialized class
ASP.NET 5 with MongoDB
Store same fields twice during serialization
BsonDefaultValue set to empty list
Don't overwrite extra fields when serializing BSON?
MongoDB C# - how to save arbitrary JSON document as dynamic type?