diff options
author | Nathan Myers <nathan.myers@10gen.com> | 2017-09-25 16:20:23 -0400 |
---|---|---|
committer | Nathan Myers <nathan.myers@10gen.com> | 2017-09-25 16:20:23 -0400 |
commit | 0939e1447aa5b4291c09c1fab2344a66098213dd (patch) | |
tree | 53675734d2c5d1378088beb3b35c77cce8ed7a15 /src/mongo/db/s/metadata_manager.cpp | |
parent | d7aca6435e8ccc89005a97dc585dfbe429a17dec (diff) | |
download | mongo-0939e1447aa5b4291c09c1fab2344a66098213dd.tar.gz |
SERVER-29136 Plumb update document key through to op log
Diffstat (limited to 'src/mongo/db/s/metadata_manager.cpp')
-rw-r--r-- | src/mongo/db/s/metadata_manager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/s/metadata_manager.cpp b/src/mongo/db/s/metadata_manager.cpp index c7d5c74052e..9e4e2efd88c 100644 --- a/src/mongo/db/s/metadata_manager.cpp +++ b/src/mongo/db/s/metadata_manager.cpp @@ -293,7 +293,8 @@ BSONObj ScopedCollectionMetadata::extractDocumentKey(BSONObj const& doc) const { if (auto id = doc["_id"_sd]) { return key.isEmpty() ? id.wrap() : BSONObjBuilder(std::move(key)).append(id).obj(); } - return key; + // For legacy documents that lack an _id, use the document itself as its key. + return doc; } ScopedCollectionMetadata::~ScopedCollectionMetadata() { |