summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/touch.cpp
diff options
context:
space:
mode:
authorMatt Kangas <matt.kangas@mongodb.com>2014-12-02 10:40:19 -0500
committerMatt Kangas <matt.kangas@mongodb.com>2015-01-08 15:53:20 -0500
commit2f816f16726fae730731a649971f256188acd2b0 (patch)
tree545f2e43aa2a0a11792a0becb4b5a48d2e829968 /src/mongo/db/commands/touch.cpp
parentf52a4ad8e5813f25bf60357978f8b08e16864bbb (diff)
downloadmongo-2f816f16726fae730731a649971f256188acd2b0.tar.gz
SERVER-16260 Accept Symbol BSON type arg for some commands
Followup to SERVER-16072 Add dbtest for commands that accept Symbol BSON type as collection name - Includes SConscript tweak to link missing "touch" command into dbtest
Diffstat (limited to 'src/mongo/db/commands/touch.cpp')
-rw-r--r--src/mongo/db/commands/touch.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp
index 115b69c0d38..d514a8ba69c 100644
--- a/src/mongo/db/commands/touch.cpp
+++ b/src/mongo/db/commands/touch.cpp
@@ -79,13 +79,9 @@ namespace mongo {
string& errmsg,
BSONObjBuilder& result,
bool fromRepl) {
- const std::string coll = cmdObj.firstElement().valuestrsafe();
- if (coll.empty()) {
- errmsg = "no collection name specified";
- return false;
- }
+ const std::string ns = parseNsCollectionRequired(dbname, cmdObj);
- const NamespaceString nss( dbname, coll );
+ const NamespaceString nss(ns);
if ( ! nss.isNormal() ) {
errmsg = "bad namespace name";
return false;