Пример #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) {}
Пример #2
0
ShardKeyPattern::ShardKeyPattern(const KeyPattern& keyPattern)
    : _keyPatternPaths(parseShardKeyPattern(keyPattern.toBSON())),
      _keyPattern(_keyPatternPaths.empty() ? KeyPattern(BSONObj()) : keyPattern) {}
Пример #3
0
 bool ShardKeyPattern::isUniqueIndexCompatible( const KeyPattern& uniqueIndexPattern ) const {
     return mongo::isUniqueIndexCompatible( pattern.toBSON(), uniqueIndexPattern.toBSON() );
 }
Пример #4
0
void ShardCollectionType::setKeyPattern(const KeyPattern& keyPattern) {
    invariant(!keyPattern.toBSON().isEmpty());
    _keyPattern = keyPattern;
}