new DatabaseQuery(databaseManager, type)
Class representing a database query.
Name | Type | Description |
---|---|---|
databaseManager |
DatabaseManager | The DatabaseManager. |
type |
string | The type of DatabaseObject to query for. |
- Source:
Members
conditions :any
- any
- Source:
getKey :string
- string
- Source:
getValue :any
- any
- Source:
maxResults :number
- number
- Source:
sort :any
- any
- Source:
subQueries :Array.<SubQuery>
- Array.<SubQuery>
- Source:
type :string
- string
- Source:
Methods
(static) and(queries) → {DatabaseQuery}
AND some queries together.
Name | Type | Description |
---|---|---|
queries |
Array.<DatabaseQuery> | The queries to AND. |
- Source:
The first query passed in, with the rest as AND SubQueries.
- Type
- DatabaseQuery
(static) or(queries) → {DatabaseQuery}
OR some queries together.
Name | Type | Description |
---|---|---|
queries |
Array.<DatabaseQuery> | The queries to OR. |
- Source:
The first query passed in, with the rest as OR SubQueries.
- Type
- DatabaseQuery
and(queries) → {this}
AND some queries to this query.
Name | Type | Description |
---|---|---|
queries |
Array.<DatabaseQuery> | The queries to AND. |
- Source:
The DatabaseQuery.
- Type
- this
equalTo(prop, val) → {this}
Add an equalTo condition.
Name | Type | Description |
---|---|---|
prop |
string | The property to check. |
val |
any | The value that the property's value must be equal to. |
- Source:
The DatabaseQuery.
- Type
- this
find() → {Promise.<Array.<DatabaseObject>>}
Execute this query.
- Source:
The DatabaseObject records, if found.
- Type
- Promise.<Array.<DatabaseObject>>
get(id) → {Promise.<(DatabaseObject|void)>}
Execute this query searching for the given id.
Name | Type | Description |
---|---|---|
id |
string | The ID to search for. |
- Source:
The DatabaseObject record, if found.
- Type
- Promise.<(DatabaseObject|void)>
greaterThan(prop, num) → {this}
Add a greaterThan condition.
Name | Type | Description |
---|---|---|
prop |
string | The property to check. |
num |
number | The number that the property's value must be greater than. |
- Source:
The DatabaseQuery.
- Type
- this
lessThan(prop, num) → {this}
Add a lessThan condition.
Name | Type | Description |
---|---|---|
prop |
string | The property to check. |
num |
number | The number that the property's value must be less than. |
- Source:
The DatabaseQuery.
- Type
- this
limit(num) → {this}
Add a limit condition.
Name | Type | Description |
---|---|---|
num |
number | The number of results to return. |
- Source:
The DatabaseQuery.
- Type
- this
notEqualTo(prop, val) → {this}
Add a notEqualTo condition.
Name | Type | Description |
---|---|---|
prop |
string | The property to check. |
val |
any | The value that the property's value must not be equal to. |
- Source:
The DatabaseQuery.
- Type
- this
or(queries) → {this}
OR some queries to this query.
Name | Type | Description |
---|---|---|
queries |
Array.<DatabaseQuery> | The queries to OR. |
- Source:
The DatabaseQuery.
- Type
- this