From d618d0349b807108d4eb8b36feaaa81d59350038 Mon Sep 17 00:00:00 2001 From: Nathan Myers Date: Fri, 11 Aug 2017 10:59:20 -0400 Subject: SERVER-29136 Better extractDocumentKey --- src/mongo/db/s/metadata_manager.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mongo/db/s/metadata_manager.h') diff --git a/src/mongo/db/s/metadata_manager.h b/src/mongo/db/s/metadata_manager.h index 7a15e47d709..48cd08df125 100644 --- a/src/mongo/db/s/metadata_manager.h +++ b/src/mongo/db/s/metadata_manager.h @@ -140,11 +140,6 @@ public: boost::optional getNextOrphanRange(BSONObj const& from); - /** - * Returns just the shard key fields, if collection is sharded, and the _id field, from `doc`. - */ - BSONObj extractDocumentKey(BSONObj const& doc); - private: // All of the following functions must be called while holding _managerLock. @@ -265,6 +260,12 @@ public: CollectionMetadata* operator->() const; CollectionMetadata* getMetadata() const; + /** + * Returns just the shard key fields, if collection is sharded, and the _id field, from `doc`. + * Does not alter any field values (e.g. by hashing); values are copied verbatim. + */ + BSONObj extractDocumentKey(BSONObj const& doc) const; + /** * True if the ScopedCollectionMetadata stores a metadata (is not empty) and the collection is * sharded. -- cgit v1.2.1