package com.mongodb.operation;
import com.mongodb.session.SessionContext;
import org.bson.BsonDocument;
import static com.mongodb.assertions.Assertions.notNull;
import static com.mongodb.internal.connection.ReadConcernHelper.getReadConcernDocument;
final class OperationReadConcernHelper {
static void appendReadConcernToCommand(final SessionContext sessionContext, final BsonDocument commandDocument) {
notNull("commandDocument", commandDocument);
notNull("sessionContext", sessionContext);
if (sessionContext.hasActiveTransaction()) {
return;
}
BsonDocument readConcernDocument = getReadConcernDocument(sessionContext);
if (!readConcernDocument.isEmpty()) {
commandDocument.append("readConcern", readConcernDocument);
}
}
private OperationReadConcernHelper() {
}
}