domain~ DatumFilter

A filter criteria object for datum.

This filter is used to query both node datum and location datum. Not all properties are applicable to both types. Be sure to consult the SolarNet API documentation on the supported properties for each type.

Constructor

new DatumFilter(propsopt)

Constructor.

Parameters:
NameTypeAttributesDescription
propsobject<optional>

initial property values

Extends

Members

accumulatingPropertyName :string

An accumulating property name.

This manages the first available value from the accumulatingPropertyNames property.

Type:
  • string

accumulatingPropertyNames :Array.<string>

An array of accumulating property names.

Type:
  • Array.<string>

aggregation :module:domain~Aggregation

An aggregation.

Including this in a filter will cause SolarNet to return aggregated results, rather than raw results.

combiningType :module:domain~CombiningType

Get the combining type.

Use this to combine nodes and/or sources into virtual groups. Requires some combination of #nodeIdMaps or #sourceIdMaps also be specified.

dataPath :string

A data path, in dot-delimited notation like i.watts.

Type:
  • string

endDate :Date

A maximum date.

Type:
  • Date

instantaneousPropertyName :string

An instantaneous property name.

This manages the first available value from the instantaneousPropertyNames property.

Type:
  • string

instantaneousPropertyNames :Array.<string>

An array of instantaneous property names.

Type:
  • Array.<string>

localEndDate :Date

A local maximum date.

Type:
  • Date

localStartDate :Date

Alocal minimumin date.

Type:
  • Date

location :module:domain~Location

A location, used as an example-based search criteria.

locationId :number

A location ID.

This manages the first available location ID from the locationIds property.

Type:
  • number

locationIds :Array.<number>

An array of location IDs.

Type:
  • Array.<number>

metadataFilter :string

A metadata filter (LDAP style search criteria).

Type:
  • string

mostRecent :boolean

The "most recent" flag.

Type:
  • boolean

nodeId :number

A node ID.

This manages the first available node ID from the nodeIds property.

Type:
  • number

nodeIdMaps :Map.<Number, Set.<Number>>

A mapping of virtual node IDs to sets of real node IDs to combine.

Type:
  • Map.<Number, Set.<Number>>

nodeIds :Array.<number>

An array of node IDs.

Type:
  • Array.<number>

partialAggregation :module:domain~Aggregation

A partial aggregation.

Including this in a filter along with aggregation will cause SolarNet to return aggregated results that include partial results of this granularity. For example if aggregation == 'Month' and partialAggregation == 'Day' and a date range of 15 Jan - 15 Mar was requested, 3 month results would be returned for the date ranges 15 Jan - 31 Jan, 1 Feb - 28 Feb, and 1 Mar - 14 Mar.

propertyName :string

A property name.

This manages the first available value from the propertyNames property.

Type:
  • string

propertyNames :Array.<string>

An array of property names.

Type:
  • Array.<string>

props :object

The object that all properties are stored on.

Type:
  • object

query :string

A general full-text style query string.

Type:
  • string

sourceId :string

A source ID.

This manages the first available source ID from the sourceIds property.

Type:
  • string

sourceIdMaps :Map.<String, Set.<String>>

A mapping of virtual source IDs to sets of real source IDs to combine.

Type:
  • Map.<String, Set.<String>>

sourceIds :Array.<string>

An array of source IDs.

Type:
  • Array.<string>

startDate :Date

A minimumin date.

Type:
  • Date

statusPropertyName :string

A property name.

This manages the first available value from the statusPropertyNames property.

Type:
  • string

statusPropertyNames :Array.<string>

An array of property names.

Type:
  • Array.<string>

streamId :string

A stream ID.

This manages the first available stream ID from the streamIds property.

Type:
  • string

streamIds :Array.<string>

An array of stream IDs.

Type:
  • Array.<string>

tags :Array.<string>

An array of tags.

Type:
  • Array.<string>

userId :number

A user ID.

This manages the first available location ID from the userIds property.

Type:
  • number

userIds :Array.<number>

An array of user IDs.

Type:
  • Array.<number>

withoutTotalResultsCount :boolean

Get the without total results flag.

Type:
  • boolean

Methods

prop(key, newValueopt) → {*}

Get, set, or remove a property value.

Parameters:
NameTypeAttributesDescription
keystring

the key to get or set the value for

newValue*<optional>

if defined, the new value to set for the given key; if null then the key property will be removed

Returns:

if called as a getter, the associated value for the given key, otherwise this object

Type: 
*

properties(newPropsopt) → {object}

Get, set, or remove multiple properties.

Parameters:
NameTypeAttributesDescription
newPropsobject<optional>

the new values to set; if any value is null that property will be deleted

Returns:

if called as a getter, all properties of this object copied into a simple object; otherwise this object

Type: 
object

toUriEncoding(propertyNameopt, callbackFnopt) → {string}

Get this object as a standard URI encoded (query parameters) string value.

All enumerable properties of the props property will be added to the result. If any property value is an array, the values of the array will be joined by a comma. Any module:util~Enum values will have their name property used. Any value that has a toUriEncoding() function property will have that function invoked, passing the associated property name as the first argument, and the returned value will be used.

Parameters:
NameTypeAttributesDescription
propertyNamestring<optional>

an optional object property prefix to add to all properties

callbackFnfunction<optional>

An optional function that will be called for each property. The function will be passed property name and value arguments, and must return either null to skip the property, a 2 or 3-element array with the property name and value to use, and an optional boolean to force array values to use mutliple parameter keys. Any other return value causes the property to be used as- is.

Returns:

the URI encoded string

Type: 
string

toUriEncodingWithSorting(sortsopt, paginationopt, propertyNameopt, callbackFnopt) → {string}

Get this object as a standard URI encoded (query parameters) string value with sorting and pagination parameters.

This calls module:util~PropMap#toUriEncoding first, then encodes the `sorts` and `pagination` parameters, if provided.

Parameters:
NameTypeAttributesDescription
sortsArray.<module:domain~SortDescriptor><optional>

optional sort settings to use

paginationmodule:domain~Pagination<optional>

optional pagination settings to use

propertyNamestring<optional>

an optional object property prefix to add to all properties

callbackFnfunction<optional>

An optional function that will be called for each property. The function will be passed property name and value arguments, and must return either null to skip the property, a 2-element array with the property name and value to use, or anything else to use the property as- is.

Returns:

the URI encoded string

Type: 
string