summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_request.cpp
diff options
context:
space:
mode:
authorMaria van Keulen <maria@mongodb.com>2017-04-25 09:44:44 -0400
committerMaria van Keulen <maria@mongodb.com>2017-04-28 14:57:37 -0400
commit9fb79929f9e957ba62c41d2114ef5a78dc4965b5 (patch)
tree73fb5936fe9940cfd444a2342399ae4c8ee07123 /src/mongo/db/query/query_request.cpp
parent5c702fedb3216b1a327d3791cd9e995fefc4ab2f (diff)
downloadmongo-9fb79929f9e957ba62c41d2114ef5a78dc4965b5.tar.gz
SERVER-27991 Allow find and listIndexes to accept UUID argument
This patch allows callers of the find and listIndexes commands to pass either a UUID or a collection name as the collection identifier argument.
Diffstat (limited to 'src/mongo/db/query/query_request.cpp')
-rw-r--r--src/mongo/db/query/query_request.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/query/query_request.cpp b/src/mongo/db/query/query_request.cpp
index 0b6d6e4c5c4..2bf9f12a15c 100644
--- a/src/mongo/db/query/query_request.cpp
+++ b/src/mongo/db/query/query_request.cpp
@@ -124,8 +124,12 @@ StatusWith<unique_ptr<QueryRequest>> QueryRequest::makeFromFindCommand(Namespace
BSONElement el = it.next();
const auto fieldName = el.fieldNameStringData();
if (fieldName == kFindCommandName) {
+ // Check both String and UUID types for "find" field.
Status status = checkFieldType(el, String);
if (!status.isOK()) {
+ status = checkFieldType(el, BinData);
+ }
+ if (!status.isOK()) {
return status;
}
} else if (fieldName == kFilterField) {