# Global

##

### Members

#### Shared

The main collection class. Collections store multiple documents and can operate on them using the query language to insert, read, update and delete.

Source:
  - Collection.js, line 8

### Methods

#### "string, object"(collectionName, options) → {Collection}

Get a collection by name. If the collection does not already exist then one is created for that name automatically.

##### Parameters:

Name | Type | Description
--- | --- | ---
`collectionName` | String | The name of the collection.
`options` | Object | An options object.

Source:
  - Collection.js, line 2931

##### Returns:

Type
  Collection

#### "string, string"(collectionName, primaryKey) → {Collection}

Get a collection by name. If the collection does not already exist then one is created for that name automatically.

##### Parameters:

Name | Type | Description
--- | --- | ---
`collectionName` | String | The name of the collection.
`primaryKey` | String | Optional primary key to specify the primary key field on the collection objects. Defaults to "_id".

Source:
  - Collection.js, line 2917

##### Returns:

Type
  Collection

#### "string, string, object"(collectionName, primaryKey, options) → {Collection}

Get a collection by name. If the collection does not already exist then one is created for that name automatically.

##### Parameters:

Name | Type | Description
--- | --- | ---
`collectionName` | String | The name of the collection.
`primaryKey` | String | Optional primary key to specify the primary key field on the collection objects. Defaults to "_id".
`options` | Object | An options object.

Source:
  - Collection.js, line 2946

##### Returns:

Type
  Collection

#### $main(options) → {*}

The main handler method. This get's called by all the other variants and handles the actual logic of the overloaded method.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | An options object.

Source:
  - Collection.js, line 2959

##### Returns:

Type
  *

#### object(options) → {Collection}

Get a collection by name. If the collection does not already exist then one is created for that name automatically.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | An options object.

Source:
  - Collection.js, line 2893

##### Returns:

Type
  Collection

#### string(collectionName) → {Collection}

Get a collection by name. If the collection does not already exist then one is created for that name automatically.

##### Parameters:

Name | Type | Description
--- | --- | ---
`collectionName` | String | The name of the collection.

Source:
  - Collection.js, line 2903

##### Returns:

Type
  Collection