TagQuery
public struct TagQueryQueries enable you to filter and aggregate data based on properties of a Tag and its data points.
Time Series tags can have properties with different types of data values that represent quality, type, attributes, etc… of a data point. For example you could query all tags and all data points whos quality is Good, filtering out quality levels less than Good.
Queries can combined multiple elements or by using a single one. For example a TagQuery could specify a grouping with an aggregation and limit of how many data points to return or it would simply be a single item like limit to the last two data points.
Example of a query that would return tags grouped by their quality level and limited to the last 3 values
   let tagGroup = TagGroup(name: "quality")
   let tagQuery = TagQuery(name: "sensorTag", group: tagGroup, limit: 3)
   ...
- 
                  
                  The order in which you want data to be returned. If no order is specified the defualt is ascending DeclarationSwift public var order: QueryResponseOrder?
- 
                  
                  Aggregations you would want to perform on the data points returned from a Time Series request DeclarationSwift public var aggregations: [TagAggregation]?
- 
                  
                  Allows data to be grouped by values specified in the TagGroup DeclarationSwift public var groups: [TagGroup]?
- 
                  
                  Limits the number of data points returned in a tag data point request DeclarationSwift public var limit: Int?
- 
                  
                  You can filter data points by attributes, qualities, and multiple tag names using a set of comparison operations. For more information please see the filters section on predix.io DeclarationSwift public var filters: [String: Any]?
- 
                  
                  The name of the tag you would like to query for DeclarationSwift public var name: String
- 
                  
                  Constructs a TagQuery with one or many of the supported types, TagGroups, TagAggregations, limits and ordering DeclarationSwift public init(name: String, groups: [TagGroup]? = nil, aggregations: [TagAggregation]? = nil, limit: Int? = nil, order: QueryResponseOrder? = nil)ParametersnameThe name of the tag you would like to query for groupsTagGroups explaining how the data should be grouped aggregationsTagAggregations for running aggregations on the retuned data points limitHow many data points to return orderThe order of the data points 
 View on GitHub
            View on GitHub
           TagQuery Structure Reference
      TagQuery Structure Reference