插入数据:
var indocument = new BsonDocument
{
{" Massageid", "978978978978"},
{"Time",DateTime.Now },
{"type", 1 }
};
collection.InsertOne(indocument);
按时间条件查询:
FilterDefinitionBuilder<BsonDocument> builderFilter = Builders<BsonDocument>.Filter;
FilterDefinition<BsonDocument> filter = builderFilter.Gt("Time",DateTime.Parse("2019-04-18 15:10:00"));
var document = collection.Find(filter).ToList();