> For the complete documentation index, see [llms.txt](https://mongo.webcore.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mongo.webcore.io/reference/traits/collection.md).

# Collection

## Metadata

### Collection Binding

#### `__bound__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;The PyMongo Collection instance this class is bound to, or `None` if not bound. Primarily meant to be used as a truthy value; utilize `.get_collection()` to acquire a handle to the PyMongo Collection if intended for use.

&#x20;Default`None`

#### `__collection__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;The string name of the collection to bind to. Can be used as a truthy value to identify if a `Document` class is top-level or not.

&#x20;Default`None`

#### `__projection__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;A **read-only** calculated property generated at class construction time identifying the default projection to utilize. This is derived from the available fields and their `project` predicates.

### Data Access Options

#### `__read_preference__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;The default read preference to utilize when binding. Must be an appropriate attribute value of the PyMongo [`ReadPreference`](http://api.mongodb.com/python/current/api/pymongo/read_preferences.html#pymongo.read_preferences.ReadPreference) object or customized instance of a [`read_preferences`](http://api.mongodb.com/python/current/api/pymongo/read_preferences.html#pymongo.read_preferences.ReadPreference) class.

&#x20;Default`ReadPreference.PRIMARY`

#### `__read_concern__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;The read concern (level of isolation) to utilize when binding. Must be a PyMongo [`ReadConcern`](http://api.mongodb.com/python/current/api/pymongo/read_concern.html) instance.

&#x20;Default`ReadConcern(level=None)`

#### `__write_concern__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;The default write concern (level of confirmation) to utilize when binding. Must be a PyMongo [`WriteConcern`](http://api.mongodb.com/python/current/api/pymongo/write_concern.html) instance.

&#x20;Default`WriteConcern(w=1, wtimeout=None, j=None, fsync=None)`

### Storage Options

#### `__collection__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;Default`None`

#### `__collection__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;Default`None`

#### `__collection__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;Default`None`

#### `__collection__` <a href="#default-values-assign" id="default-values-assign"></a>

&#x20;Default`None`
