Value ExpressionConvert::serialize(bool explain) const {
    return Value(Document{{"$convert",
                           Document{{"input", _input->serialize(explain)},
                                    {"to", _to->serialize(explain)},
                                    {"onError", _onError ? _onError->serialize(explain) : Value()},
                                    {"onNull", _onNull ? _onNull->serialize(explain) : Value()}}}});
}
Value ExpressionConvert::serialize(bool explain) const {
    return Value(Document{{"$convert",
                           Document{{"input", _input->serialize(explain)},
                                    {"to", _to->serialize(explain)},
                                    {"onError", _onError ? _onError->serialize(explain) : Value()},
                                    {"onNull", _onNull ? _onNull->serialize(explain) : Value()}}}});
}