diff options
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r-- | src/mongo/db/commands.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index b08163fb248..83c44496d3c 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -147,9 +147,18 @@ struct CommandHelpers { * appended to 'dbname' after a '.' character. If the first field is not of type * mongo::String, then 'dbname' is returned unmodified. */ + // TODO SERVER-68423: Remove this method once all call sites have been updated to pass + // DatabaseName. static std::string parseNsFromCommand(StringData dbname, const BSONObj& cmdObj); /** + * Return the namespace for the command. If the first field in 'cmdObj' is of type + * mongo::String, then that field is interpreted as the collection name. + * If the first field is not of type mongo::String, then the namespace only has database name. + */ + static NamespaceString parseNsFromCommand(const DatabaseName& dbName, const BSONObj& cmdObj); + + /** * Utility that returns a ResourcePattern for the namespace returned from * BasicCommand::parseNs(dbname, cmdObj). This will be either an exact namespace resource * pattern or a database resource pattern, depending on whether parseNs returns a fully qualifed |