Interface: DataSource

.Service. DataSource

The datasource object for use as an interface for a datasource

Source:

Members


<static> this.client

Properties:
Name Type Description
client object

The client for use in the DataSource

Source:

<static> this.collection

Properties:
Name Type Description
collection object

The collection for use in the DataSource

Source:

<static> this.db

Properties:
Name Type Description
db object

The database (or simular) for the datasource (if applicable)

Source:

<static> this.url

Properties:
Name Type Description
url string

The url for the datasource (if applicable)

Source:

Methods


<static> closeConnection Close a connection to the DataSource ()

Source:
Returns:

Returns true if a connection is established

Type
boolean

<static> getCollection Get the collection()

Source:
Returns:

Returns the collection

Type
object

<static> getConnection Get a connection to the DataSource()

Source:
Returns:

Returns true if a connection is established

Type
boolean

<static> insert Insert data(data)

Parameters:
Name Type Description
data object

Data to insert

Source:

<static> query Query data(query, callback)

Parameters:
Name Type Description
query object

The query object

callback function

A callback to execute during the query

Source:
Returns:

Returns a value from the query or response code

Type
object

<static> remove Remove data(data)

Parameters:
Name Type Description
data object

Data to remove

Source:

<static> setCollection Set the collection by name(name)

Parameters:
Name Type Description
name string

The name of the collection

Source:

<static> update Update data(data)

Parameters:
Name Type Description
data object

Data to update

Source: