查询Message表中 不包含某些内容
var filter = Builders<Message>.Filter.Gte(item => item.SendTime, StatDate); filter &= Builders<Message>.Filter.Lte(item => item.SendTime, EndDate); filter &= Builders<Message>.Filter.Eq(item => item.GameId, (uint)Mconfig.GameId); filter &= Builders<Message>.Filter.Not(Builders<Message>.Filter.Or( Builders<Message>.Filter.Regex(item => item.Content, new BsonRegularExpression(new Regex("IGame.TeamClient:RequestJoinTeamFromChannel"))), Builders<Message>.Filter.Regex(item => item.Content, new BsonRegularExpression(new Regex("ZC_movetoMirror"))), Builders<Message>.Filter.Regex(item => item.Content, new BsonRegularExpression(new Regex("UIManager.MarryWindow:ShowWindow"))), Builders<Message>.Filter.Regex(item => item.Content, new BsonRegularExpression(new Regex("ShowEntityTips"))) ));
查询内容中含有message的信息
Builders<Message>.Filter.Regex(item => item.Content, new BsonRegularExpression(new Regex("message")));