AdvancedAggregateAssetAttribute
Runs aggregations on timelined asset attributes. The Aggregation is limited to the Asset that was requested. See: https://www.mongodb.com/docs/manual/aggregation/ and https://www.mongodb.com/docs/php-library/current/aggregation/ and https://www.mongodb.com/docs/php-library/current/reference/method/mongodbcollection-aggregate/ Send the configurations as JSON to pipeline as Array of a set of aggregation stages The following commands are allowed: bucket bucketAuto count facet geoNear group limit match merge sample search skip sortByCount unset unwind See https://www.mongodb.com/docs/manual/reference/operator/aggregation for all aggregation operators available. Asset Alias, Attribute Name(s) and Time Intervals can not be altered or expanded in the aggregation. You can automatically limit your results to a Time Range giving ISO 8601 Timeformatted Strings to startDate and/or endDate.
RPC Configuration
Rpc Name:
Plain: AdvancedAggregateAssetAttribute
Sha1: 57a618993df4ab5c08e5da47ff7b3dae2067baa8
RPCs can be called by their plain name or their SHA1 representation.
Rpc Parameters:
"userToken" : string,
"sharedSecret" : string,
"assetAlias" : string,
"attributeName" : array|string,
"pipeline" : array = [],
"startDate" : string = ,
"endDate" : string =
@param string|array attributeName The Name of the Attribute to aggegate,
or an array with all attributes names that should be used in the aggregation function.
@param array pipeline = [] Define your Aggregation-Pipeline with valid aggregation stages.
@param string startDate Optional, ISO 8601 compatible date string for the minimum range (less-equal)
@param string endDate Optional, ISO 8601 compatible date string for the maximum range (greater-equal)
Requires Login:
true
Requires Context:
The context providing parameter can either be a contagt-id (8-Bytes, Alphaumeric) or an integer as a building id. The context parameter name should make the choice obviouse, the type has not to be defined manually.
false
Requires WriteAccess:
Only accounts that have an explicit write access to the defined context can execute this RPC, no matter if the authentication level matches or not.
false
Requires AuthenticationLevel:
Authentication levels allow the SuperUser to define a by-RPC granular access configuration. If RPCs are chained in a single unified call and lenient is enabled, all allowed RPCs will be executed, while execution will fail entirely with lenient set to false.
LOCAL_ADMINISTRATOR
Requires Subbuilding Merge Strategy:
REPLACE
Cache Configuration
All writing RPCs are not Cacheable, also Caching will be disabled by the paramters nocache
and readonly
.
Cache enabled:
false
Account Method Authentication
This RPC requires Account Method Authenticaton with the following configuration:
Requires Account Login:
The Account login is not the default api login. See LoginViaUser and LoginViaEmail
true
Account Usertoken Parameter Name:
This Usertoken is not the same one, as the api login usertoken.
userToken
Account Shared Secret Parameter Name:
sharedSecret
Requires Asset Permission:
true
Sample Request
->
{
"userToken": "MX8Tndlt3Qx5LdSsygHfq8gJd3v5Qdb4HKfuD7qXKo5RFU3fF1W7dQeHvEqg1eBL",
"sharedSecret": "ea75c32046a8be46a47474931df9ffe4",
"assetAlias": "My_Third_Asset",
"attributeName": [
"rx",
"tx"
],
"pipeline": {
"$group": {
"_id": {
"attributeName": "$attributeName"
}
}
}
}