C# mongo queries with json strings
问题 This seems so basic that I'm sure I've just overlooked a class or a method somewhere, but for the life of me, I can't find it. I've got a json string like so: { SendId: 4, "Events.Code" : { $all : [2], $nin : [3] } } I can run this in the mongo shell against a find() or a count() and get what I'm looking for. What is the easiest way to deal with this in C#? Here's what I've found: The methods I'm finding are all wanting an IMongoQuery , which is just a marker interface BsonDocument has a nice