diff options
Diffstat (limited to 'src/mongo/db/s/get_shard_version_command.cpp')
-rw-r--r-- | src/mongo/db/s/get_shard_version_command.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/s/get_shard_version_command.cpp b/src/mongo/db/s/get_shard_version_command.cpp index cd5a8febb8e..19f2d965b56 100644 --- a/src/mongo/db/s/get_shard_version_command.cpp +++ b/src/mongo/db/s/get_shard_version_command.cpp @@ -110,15 +110,15 @@ public: CollectionShardingState* const css = CollectionShardingState::get(opCtx, nss); const auto metadata = css->getMetadata(opCtx); - if (metadata) { + if (metadata->isSharded()) { result.appendTimestamp("global", metadata->getShardVersion().toLong()); } else { - result.appendTimestamp("global", ChunkVersion(0, 0, OID()).toLong()); + result.appendTimestamp("global", ChunkVersion::UNSHARDED().toLong()); } if (cmdObj["fullMetadata"].trueValue()) { BSONObjBuilder metadataBuilder(result.subobjStart("metadata")); - if (metadata) { + if (metadata->isSharded()) { metadata->toBSONBasic(metadataBuilder); BSONArrayBuilder chunksArr(metadataBuilder.subarrayStart("chunks")); |