# 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`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mongo.webcore.io/reference/traits/collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
