Exemplo n.º 1
0
BSONObj ReadPreferenceSetting::toBSON() const {
    BSONObjBuilder bob;
    bob.append(kModeFieldName, readPreferenceName(pref));
    if (tags != defaultTagSetForMode(pref)) {
        bob.append(kTagsFieldName, tags.getTagBSON());
    }
    return bob.obj();
}
Exemplo n.º 2
0
void ReadPreferenceSetting::toInnerBSON(BSONObjBuilder* bob) const {
    bob->append(kModeFieldName, readPreferenceName(pref));
    if (tags != defaultTagSetForMode(pref)) {
        bob->append(kTagsFieldName, tags.getTagBSON());
    }
    if (maxStalenessSeconds.count() > 0) {
        bob->append(kMaxStalenessSecondsFieldName, maxStalenessSeconds.count());
    }
}