diff options
Diffstat (limited to 'src/mongo/db/api_parameters.h')
-rw-r--r-- | src/mongo/db/api_parameters.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/api_parameters.h b/src/mongo/db/api_parameters.h index efbebfabfcc..34c129bca15 100644 --- a/src/mongo/db/api_parameters.h +++ b/src/mongo/db/api_parameters.h @@ -49,6 +49,11 @@ public: static APIParameters fromClient(const APIParametersFromClient& apiParamsFromClient); static APIParameters fromBSON(const BSONObj& cmdObj); + // For use with unordered_map. + struct Hash { + std::size_t operator()(const APIParameters& params) const; + }; + void appendInfo(BSONObjBuilder* builder) const; const boost::optional<std::string>& getAPIVersion() const { @@ -85,6 +90,14 @@ private: boost::optional<bool> _apiDeprecationErrors; }; +inline bool operator==(const APIParameters& lhs, const APIParameters& rhs) { + return lhs.getAPIVersion() == rhs.getAPIVersion() && lhs.getAPIStrict() == rhs.getAPIStrict() && + lhs.getAPIDeprecationErrors() == rhs.getAPIDeprecationErrors(); +} + +inline bool operator!=(const APIParameters& lhs, const APIParameters& rhs) { + return !(lhs == rhs); +} /** * Temporarily remove the user's API parameters from an OperationContext. |