Пример #1
0
    BSONObj ShardType::toBSON() const {
        BSONObjBuilder builder;

        if (_name) builder.append(name(), getName());
        if (_host) builder.append(host(), getHost());
        if (_draining) builder.append(draining(), getDraining());
        if (_maxSize) builder.append(maxSize(), getMaxSize());
        if (_tags) builder.append(tags(), getTags());

        return builder.obj();
    }
Пример #2
0
BSONObj ShardType::toBSON() const {
    BSONObjBuilder builder;

    if (_name)
        builder.append(name(), getName());
    if (_host)
        builder.append(host(), getHost());
    if (_draining)
        builder.append(draining(), getDraining());
    if (_maxSizeMB)
        builder.append(maxSizeMB(), getMaxSizeMB());
    if (_tags)
        builder.append(tags(), getTags());
    if (_state)
        builder.append(state(), static_cast<std::underlying_type<ShardState>::type>(getState()));

    return builder.obj();
}