BSONObj Command::appendMajorityWriteConcern(const BSONObj& cmdObj) {
    if (cmdObj.hasField(kWriteConcernField)) {
        return cmdObj;
    }
    BSONObjBuilder cmdObjWithWriteConcern;
    cmdObjWithWriteConcern.appendElementsUnique(cmdObj);
    cmdObjWithWriteConcern.append(kWriteConcernField, kMajorityWriteConcern.toBSON());
    return cmdObjWithWriteConcern.obj();
}
BSONObj Command::appendMajorityWriteConcern(const BSONObj& cmdObj) {
    if (cmdObj.hasField(kWriteConcernField)) {
        return cmdObj;
    }
    BSONObjBuilder cmdObjWithWriteConcern;
    cmdObjWithWriteConcern.appendElementsUnique(cmdObj);
    cmdObjWithWriteConcern.append(kWriteConcernField, kMajorityWriteConcern.toBSON());
    return cmdObjWithWriteConcern.obj();
}