summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/count_command_as_aggregation_command.cpp
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/count_command_as_aggregation_command.cpp
parentf8a1ac19be6279e7ace012dafa8cfcaa028d49e1 (diff)
downloadmongo-958ad9abfc80861d3f43f44da694e83464b01e1d.tar.gz
SERVER-68246 rewrite calls to boost::optional get and is_initialized
Diffstat (limited to 'src/mongo/db/query/count_command_as_aggregation_command.cpp')
-rw-r--r--src/mongo/db/query/count_command_as_aggregation_command.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/query/count_command_as_aggregation_command.cpp b/src/mongo/db/query/count_command_as_aggregation_command.cpp
index b719ab77c86..aa3d761626b 100644
--- a/src/mongo/db/query/count_command_as_aggregation_command.cpp
+++ b/src/mongo/db/query/count_command_as_aggregation_command.cpp
@@ -65,13 +65,13 @@ StatusWith<BSONObj> countCommandAsAggregationCommand(const CountCommandRequest&
if (auto skip = cmd.getSkip()) {
BSONObjBuilder skipBuilder(pipelineBuilder.subobjStart());
- skipBuilder.append("$skip", skip.get());
+ skipBuilder.append("$skip", skip.value());
skipBuilder.doneFast();
}
if (auto limit = cmd.getLimit()) {
BSONObjBuilder limitBuilder(pipelineBuilder.subobjStart());
- limitBuilder.append("$limit", limit.get());
+ limitBuilder.append("$limit", limit.value());
limitBuilder.doneFast();
}
@@ -82,27 +82,27 @@ StatusWith<BSONObj> countCommandAsAggregationCommand(const CountCommandRequest&
// Complete the command by appending the other options to the aggregate command.
if (auto collation = cmd.getCollation()) {
- aggregationBuilder.append(kCollationField, collation.get());
+ aggregationBuilder.append(kCollationField, collation.value());
}
aggregationBuilder.append(kHintField, cmd.getHint());
if (auto maxTime = cmd.getMaxTimeMS()) {
- if (maxTime.get() > 0) {
- aggregationBuilder.append(kMaxTimeMSField, maxTime.get());
+ if (maxTime.value() > 0) {
+ aggregationBuilder.append(kMaxTimeMSField, maxTime.value());
}
}
if (auto readConcern = cmd.getReadConcern()) {
if (!readConcern->isEmpty()) {
- aggregationBuilder.append(kReadConcernField, readConcern.get());
+ aggregationBuilder.append(kReadConcernField, readConcern.value());
}
}
if (auto unwrapped = cmd.getQueryOptions()) {
if (!unwrapped->isEmpty()) {
aggregationBuilder.append(query_request_helper::kUnwrappedReadPrefField,
- unwrapped.get());
+ unwrapped.value());
}
}