diff options
author | Matt Kangas <matt.kangas@mongodb.com> | 2014-12-02 10:40:19 -0500 |
---|---|---|
committer | Matt Kangas <matt.kangas@mongodb.com> | 2015-01-08 15:53:20 -0500 |
commit | 2f816f16726fae730731a649971f256188acd2b0 (patch) | |
tree | 545f2e43aa2a0a11792a0becb4b5a48d2e829968 /src/mongo/db/commands/touch.cpp | |
parent | f52a4ad8e5813f25bf60357978f8b08e16864bbb (diff) | |
download | mongo-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.cpp | 8 |
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; |