summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_find.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-04-26 09:36:41 -0400
committerMathias Stearn <mathias@10gen.com>2017-05-12 12:08:30 -0400
commitf2902d59175c0724944ca98d13f784e2de944053 (patch)
tree44788ee704540d420f649279053019e3b6a332b2 /src/mongo/s/query/cluster_find.cpp
parent1a955fc356627b8cc74eb15506608dd987184608 (diff)
downloadmongo-f2902d59175c0724944ca98d13f784e2de944053.tar.gz
SERVER-28814 Replace ServerSelectionMetadata with just ReadPreferenceSetting
Diffstat (limited to 'src/mongo/s/query/cluster_find.cpp')
-rw-r--r--src/mongo/s/query/cluster_find.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp
index 0dd13e834d5..c282fee7800 100644
--- a/src/mongo/s/query/cluster_find.cpp
+++ b/src/mongo/s/query/cluster_find.cpp
@@ -470,15 +470,7 @@ StatusWith<ReadPreferenceSetting> ClusterFind::extractUnwrappedReadPref(const BS
if (status.isOK()) {
// There must be a nested object containing the read preference if there is a queryOptions
// field.
- BSONObj queryOptionsObj = queryOptionsElt.Obj();
- invariant(queryOptionsObj[QueryRequest::kWrappedReadPrefField].type() == BSONType::Object);
- BSONObj readPrefObj = queryOptionsObj[QueryRequest::kWrappedReadPrefField].Obj();
-
- auto readPref = ReadPreferenceSetting::fromBSON(readPrefObj);
- if (!readPref.isOK()) {
- return readPref.getStatus();
- }
- return readPref.getValue();
+ return ReadPreferenceSetting::fromContainingBSON(queryOptionsElt.Obj());
} else if (status != ErrorCodes::NoSuchKey) {
return status;
}