From 2f816f16726fae730731a649971f256188acd2b0 Mon Sep 17 00:00:00 2001 From: Matt Kangas Date: Tue, 2 Dec 2014 10:40:19 -0500 Subject: 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 --- src/mongo/db/commands/touch.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mongo/db/commands/touch.cpp') 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; -- cgit v1.2.1