private void AddElementWithValue(Expression value)
        {
            var memberMap = _lastField == null ? null : _lastField.MemberMap;
            var bsonValue = new BsonValueFormatter().GetValue(memberMap, value);

            AddElementWithValue(bsonValue);
        }
        protected override Expression VisitBinary(BinaryExpression node)
        {
            string operandName = null;

            switch (node.NodeType)
            {
            case ExpressionType.And:
            case ExpressionType.AndAlso:
                VisitBinaryAnd(node);
                return(node);

            case ExpressionType.Or:
            case ExpressionType.OrElse:
                VisitBinaryOr(node);
                return(node);

            case ExpressionType.Equal:
                break;

            case ExpressionType.GreaterThan:
                operandName = "$gt";
                break;

            case ExpressionType.GreaterThanOrEqual:
                operandName = "$gte";
                break;

            case ExpressionType.LessThan:
                operandName = "$lt";
                break;

            case ExpressionType.LessThanOrEqual:
                operandName = "$lte";
                break;

            case ExpressionType.NotEqual:
                operandName = "$ne";
                break;
            }

            VisitPredicate(node.Left);

            var value = new BsonValueFormatter().GetValue(_lastField.MemberMap, node.Right);

            if (operandName == null) //equals
            {
                AddElementWithValue(value);
            }
            else
            {
                AddElementWithValue(new BsonDocument(operandName, value));
            }

            return(node);
        }