Voeg BSON-attribuut toe aan dateTime-veld (zie hieronder),
je kunt de linqu-syntaxis gebruiken om zo'n query te maken
var min = new DateTime(2016, 03, 03, 22, 0, 0);
var max = (new DateTime(2016, 03, 03, 23, 0, 0));
List<TestClassForMongo> searchResult = collection.Find(
x => x.CreatedDateUtc > min &
x.CreatedDateUtc < max
).ToList();
public class TestClassForMongo
{
public ObjectId Id { get; set; }
[BsonDateTimeOptions]
public DateTime CreatedDateUtc { get; set; }
public string Message { get; set; }
}