Storage Engine API
mongo::CollectionOptions Struct Reference

#include <collection_options.h>

Public Types

enum  ParseKind { parseForCommand, parseForStorage }
 The 'uuid' member is a collection property stored in the catalog with user-settable options, but is not valid for the user to specify as collection option. More...
 
enum  { DEFAULT, YES, NO }
 
enum  UserFlags { Flag_UsePowerOf2Sizes = 1 << 0, Flag_NoPadding = 1 << 1 }
 

Public Member Functions

bool isView () const
 Returns true if the options indicate the namespace is a view. More...
 
Status validateForStorage () const
 Confirms that collection options can be converted to BSON and back without errors. More...
 
Status parse (const BSONObj &obj, ParseKind kind=parseForCommand)
 Parses the "options" subfield of the collection info object. More...
 
void appendBSON (BSONObjBuilder *builder) const
 
BSONObj toBSON () const
 
bool matchesStorageOptions (const CollectionOptions &other, CollatorFactoryInterface *collatorFactory) const
 Returns true if given options matches to this. More...
 
void setNoIdIndex ()
 

Static Public Member Functions

static bool validMaxCappedDocs (long long *max)
 

Public Attributes

OptionalCollectionUUID uuid
 
bool capped = false
 
long long cappedSize = 0
 
long long cappedMaxDocs = 0
 
long long initialNumExtents = 0
 
std::vector< long long > initialExtentSizes
 
enum mongo::CollectionOptions:: { ... }  autoIndexId = DEFAULT
 
int flags = Flag_UsePowerOf2Sizes
 
bool flagsSet = false
 
bool temp = false
 
BSONObj storageEngine
 
BSONObj indexOptionDefaults
 
BSONObj idIndex
 
BSONObj validator
 
std::string validationAction
 
std::string validationLevel
 
BSONObj collation
 
std::string viewOn
 
BSONObj pipeline
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT 
YES 
NO 

◆ ParseKind

The 'uuid' member is a collection property stored in the catalog with user-settable options, but is not valid for the user to specify as collection option.

So, parsing commands must reject the 'uuid' property, but parsing stored options must accept it.

Enumerator
parseForCommand 
parseForStorage 

◆ UserFlags

Enumerator
Flag_UsePowerOf2Sizes 
Flag_NoPadding 

Member Function Documentation

◆ appendBSON()

void mongo::CollectionOptions::appendBSON ( BSONObjBuilder *  builder) const

◆ isView()

bool mongo::CollectionOptions::isView ( ) const

Returns true if the options indicate the namespace is a view.

◆ matchesStorageOptions()

bool mongo::CollectionOptions::matchesStorageOptions ( const CollectionOptions other,
CollatorFactoryInterface *  collatorFactory 
) const

Returns true if given options matches to this.

Uses the collatorFactory to normalize the collation property being compared.

Note: ignores idIndex property.

◆ parse()

Status mongo::CollectionOptions::parse ( const BSONObj &  obj,
ParseKind  kind = parseForCommand 
)

Parses the "options" subfield of the collection info object.

◆ setNoIdIndex()

void mongo::CollectionOptions::setNoIdIndex ( )
inline

◆ toBSON()

BSONObj mongo::CollectionOptions::toBSON ( ) const

◆ validateForStorage()

Status mongo::CollectionOptions::validateForStorage ( ) const

Confirms that collection options can be converted to BSON and back without errors.

◆ validMaxCappedDocs()

bool mongo::CollectionOptions::validMaxCappedDocs ( long long *  max)
static
Parameters
maxin and out, will be adjusted
Returns
if the value is valid at all

Member Data Documentation

◆ autoIndexId

enum { ... } mongo::CollectionOptions::autoIndexId

◆ capped

bool mongo::CollectionOptions::capped = false

◆ cappedMaxDocs

long long mongo::CollectionOptions::cappedMaxDocs = 0

◆ cappedSize

long long mongo::CollectionOptions::cappedSize = 0

◆ collation

BSONObj mongo::CollectionOptions::collation

◆ flags

int mongo::CollectionOptions::flags = Flag_UsePowerOf2Sizes

◆ flagsSet

bool mongo::CollectionOptions::flagsSet = false

◆ idIndex

BSONObj mongo::CollectionOptions::idIndex

◆ indexOptionDefaults

BSONObj mongo::CollectionOptions::indexOptionDefaults

◆ initialExtentSizes

std::vector<long long> mongo::CollectionOptions::initialExtentSizes

◆ initialNumExtents

long long mongo::CollectionOptions::initialNumExtents = 0

◆ pipeline

BSONObj mongo::CollectionOptions::pipeline

◆ storageEngine

BSONObj mongo::CollectionOptions::storageEngine

◆ temp

bool mongo::CollectionOptions::temp = false

◆ uuid

OptionalCollectionUUID mongo::CollectionOptions::uuid

◆ validationAction

std::string mongo::CollectionOptions::validationAction

◆ validationLevel

std::string mongo::CollectionOptions::validationLevel

◆ validator

BSONObj mongo::CollectionOptions::validator

◆ viewOn

std::string mongo::CollectionOptions::viewOn

The documentation for this struct was generated from the following files: