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:
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:
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:
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:
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:
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:
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:
Returns:
- Type
- Collection