    const BSONElement& chk(int t) const {
        if (t != type()) {
            StringBuilder ss;
            if (eoo())
                ss << "field not found, expected type " << t;
            else
                ss << "wrong type for field (" << fieldName() << ") " << type() << " != " << t;
            msgasserted(13111, ss.str());
        }
        return *this;
    }
    const BSONElement& chk(int t) const {
        if (t != type()) {
            StringBuilder ss;
            if (eoo())
                ss << "field not found, expected type " << t;
            else
                ss << "wrong type for field (" << fieldName() << ") " << type() << " != " << t;
            msgasserted(13111, ss.str());
        }
        return *this;
    }