new CollectionGroup()
Creates a new collection group. Collection groups allow single operations to be
propagated to multiple collections at once. CRUD operations against a collection
group are in fed to the group's collections. Useful when separating out slightly
different data into multiple collections but querying as one collection.
- Source:
Methods
(private) _addOldView(view) → {Collection}
Adds a view to the internal view lookup.
Parameters:
Name | Type | Description |
---|---|---|
view |
View | The view to add. |
- Source:
Returns:
- Type
- Collection
(private) _removeOldView(view) → {Collection}
Removes a view from the internal view lookup.
Parameters:
Name | Type | Description |
---|---|---|
view |
View | The view to remove. |
- Source:
Returns:
- Type
- Collection
drop() → {boolean}
Drops a collection group from the database.
- Source:
Returns:
True on success, false on failure.
- Type
- boolean
primaryKey(keyNameopt) → {*}
Gets / sets the primary key for this collection group.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keyName |
String |
<optional> |
The name of the primary key. |
- Source:
Returns:
- Type
- *
removeById(id)
Helper method that removes a document that matches the given id.
Parameters:
Name | Type | Description |
---|---|---|
id |
String | The id of the document to remove. |
- Source:
subset(query, options) → {*}
Uses the passed query to generate a new collection with results
matching the query parameters.
Parameters:
Name | Type | Description |
---|---|---|
query |
||
options |
- Source:
Returns:
- Type
- *