ShardCollectionType::ShardCollectionType(const NamespaceString& uuid, const NamespaceString& nss, const OID& epoch, const KeyPattern& keyPattern, const BSONObj& defaultCollation, const bool& unique) : _uuid(uuid), _nss(nss), _epoch(epoch), _keyPattern(keyPattern.toBSON()), _defaultCollation(defaultCollation.getOwned()), _unique(unique) {}
ShardKeyPattern::ShardKeyPattern(const KeyPattern& keyPattern) : _keyPatternPaths(parseShardKeyPattern(keyPattern.toBSON())), _keyPattern(_keyPatternPaths.empty() ? KeyPattern(BSONObj()) : keyPattern) {}
bool ShardKeyPattern::isUniqueIndexCompatible( const KeyPattern& uniqueIndexPattern ) const { return mongo::isUniqueIndexCompatible( pattern.toBSON(), uniqueIndexPattern.toBSON() ); }
void ShardCollectionType::setKeyPattern(const KeyPattern& keyPattern) { invariant(!keyPattern.toBSON().isEmpty()); _keyPattern = keyPattern; }