Esempio n. 1
0
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) {}
Esempio n. 3
0
 bool ShardKeyPattern::isUniqueIndexCompatible( const KeyPattern& uniqueIndexPattern ) const {
     return mongo::isUniqueIndexCompatible( pattern.toBSON(), uniqueIndexPattern.toBSON() );
 }
Esempio n. 4
0
void ShardCollectionType::setKeyPattern(const KeyPattern& keyPattern) {
    invariant(!keyPattern.toBSON().isEmpty());
    _keyPattern = keyPattern;
}