Class: PouchDBDataCollection

(abstract, protected) PouchDBDataCollection(dataService, db, collectionId, uuid)

Base class representing a data collection provided by a DataService.

Constructor

(abstract, protected) new PouchDBDataCollection(dataService, db, collectionId, uuid)

Constructor.

Parameters:
Name Type Description
dataService DataService

The owning data service.

db Dexie

The database to use.

collectionId string

The collection ID to use.

uuid string

The uuid to use

Source:

Methods

(abstract) add(id, object, force) → {Promise}

Add an object to the collection.

Parameters:
Name Type Description
id string

The ID of the object.

object Object

The object.

force boolean

Whether to force creation without checking it already exists.

Source:
Returns:

A promise that will be resolved when complete, or rejected
with an error.

Type
Promise

(abstract) exists(id) → {Promise}

Determine whether the specified object exists in this collection.

Parameters:
Name Type Description
id string

The ID of the object.

Source:
Returns:

A promise that will be resolved with a boolean indicating
whether the object exists.

Type
Promise

(abstract) get(id) → {Promise}

Get the specified object in this collection.

Parameters:
Name Type Description
id string

The ID of the object.

Source:
Returns:

A promise that will be resolved with an object, or rejected
with an error.

Type
Promise

(abstract) getAll() → {Promise}

Get all of the objects in this collection.

Source:
Returns:

A promise that will be resolved with an array of objects,
or rejected with an error.

Type
Promise

(abstract) remove(id) → {Promise}

Remove an object from the collection.

Parameters:
Name Type Description
id string

The ID of the object.

Source:
Returns:

A promise that will be resolved when complete, or rejected
with an error.

Type
Promise

(abstract) update(id, object) → {Promise}

Add an object to the collection.

Parameters:
Name Type Description
id string

The ID of the object.

object Object

The object.

Source:
Returns:

A promise that will be resolved when complete, or rejected
with an error.

Type
Promise