summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/fle
diff options
context:
space:
mode:
authorBilly Donahue <BillyDonahue@users.noreply.github.com>2022-07-27 18:17:24 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-27 19:38:08 +0000
commit958ad9abfc80861d3f43f44da694e83464b01e1d (patch)
treeca14e7097c1cb8ab20dfad7fa6888511f0226650 /src/mongo/db/query/fle
parentf8a1ac19be6279e7ace012dafa8cfcaa028d49e1 (diff)
downloadmongo-958ad9abfc80861d3f43f44da694e83464b01e1d.tar.gz
SERVER-68246 rewrite calls to boost::optional get and is_initialized
Diffstat (limited to 'src/mongo/db/query/fle')
-rw-r--r--src/mongo/db/query/fle/server_rewrite.cpp22
-rw-r--r--src/mongo/db/query/fle/server_rewrite_test.cpp2
2 files changed, 12 insertions, 12 deletions
diff --git a/src/mongo/db/query/fle/server_rewrite.cpp b/src/mongo/db/query/fle/server_rewrite.cpp
index 2aeb99a4061..3b35678eee7 100644
--- a/src/mongo/db/query/fle/server_rewrite.cpp
+++ b/src/mongo/db/query/fle/server_rewrite.cpp
@@ -89,7 +89,7 @@ boost::intrusive_ptr<ExpressionInternalFLEEqual> generateFleEqualMatch(StringDat
expCtx,
ExpressionFieldPath::createPathFromString(
expCtx, path.toString(), expCtx->variablesParseState),
- tokens.serverToken.get().data,
+ tokens.serverToken.value().data,
tokens.maxCounter.value_or(0LL),
tokens.edcToken.data);
}
@@ -110,7 +110,7 @@ std::unique_ptr<ExpressionInternalFLEEqual> generateFleEqualMatchUnique(StringDa
expCtx,
ExpressionFieldPath::createPathFromString(
expCtx, path.toString(), expCtx->variablesParseState),
- tokens.serverToken.get().data,
+ tokens.serverToken.value().data,
tokens.maxCounter.value_or(0LL),
tokens.edcToken.data);
}
@@ -144,20 +144,20 @@ static stdx::unordered_map<std::type_index, std::function<void(FLEQueryRewriter*
void rewriteMatch(FLEQueryRewriter* rewriter, DocumentSourceMatch* source) {
if (auto rewritten = rewriter->rewriteMatchExpression(source->getQuery())) {
- source->rebuild(rewritten.get());
+ source->rebuild(rewritten.value());
}
}
void rewriteGeoNear(FLEQueryRewriter* rewriter, DocumentSourceGeoNear* source) {
if (auto rewritten = rewriter->rewriteMatchExpression(source->getQuery())) {
- source->setQuery(rewritten.get());
+ source->setQuery(rewritten.value());
}
}
void rewriteGraphLookUp(FLEQueryRewriter* rewriter, DocumentSourceGraphLookUp* source) {
if (auto filter = source->getAdditionalFilter()) {
- if (auto rewritten = rewriter->rewriteMatchExpression(filter.get())) {
- source->setAdditionalFilter(rewritten.get());
+ if (auto rewritten = rewriter->rewriteMatchExpression(filter.value())) {
+ source->setAdditionalFilter(rewritten.value());
}
}
@@ -396,7 +396,7 @@ BSONObj rewriteEncryptedFilter(const FLEStateCollectionReader& escReader,
if (auto rewritten =
FLEQueryRewriter(expCtx, escReader, eccReader, mode).rewriteMatchExpression(filter)) {
- return rewritten.get();
+ return rewritten.value();
}
return filter;
@@ -514,8 +514,8 @@ BSONObj rewriteEncryptedFilterInsideTxn(FLEQueryInterface* queryImpl,
auto docCount = queryImpl->countDocuments(nss);
return TxnCollectionReader(docCount, queryImpl, nss);
};
- auto escReader = makeCollectionReader(queryImpl, efc.getEscCollection().get());
- auto eccReader = makeCollectionReader(queryImpl, efc.getEccCollection().get());
+ auto escReader = makeCollectionReader(queryImpl, efc.getEscCollection().value());
+ auto eccReader = makeCollectionReader(queryImpl, efc.getEccCollection().value());
return rewriteEncryptedFilter(escReader, eccReader, expCtx, filter, mode);
}
@@ -549,7 +549,7 @@ void processFindCommand(OperationContext* opCtx,
findCommand->setFilter(rewriteQuery(opCtx,
expCtx,
nss,
- findCommand->getEncryptionInformation().get(),
+ findCommand->getEncryptionInformation().value(),
findCommand->getFilter().getOwned(),
getTransaction,
HighCardinalityModeAllowed::kAllow));
@@ -574,7 +574,7 @@ void processCountCommand(OperationContext* opCtx,
countCommand->setQuery(rewriteQuery(opCtx,
expCtx,
nss,
- countCommand->getEncryptionInformation().get(),
+ countCommand->getEncryptionInformation().value(),
countCommand->getQuery().getOwned(),
getTxn,
HighCardinalityModeAllowed::kAllow));
diff --git a/src/mongo/db/query/fle/server_rewrite_test.cpp b/src/mongo/db/query/fle/server_rewrite_test.cpp
index 034de8f0aa9..0e16375c665 100644
--- a/src/mongo/db/query/fle/server_rewrite_test.cpp
+++ b/src/mongo/db/query/fle/server_rewrite_test.cpp
@@ -50,7 +50,7 @@ public:
BSONObj rewriteMatchExpressionForTest(const BSONObj& obj) {
auto res = rewriteMatchExpression(obj);
- return res ? res.get() : obj;
+ return res ? res.value() : obj;
}
};