Details
|
|
---|---|
Description
|
Returns the count of properties specified by the query criteria.
|
Parameters
|
query
• QUERY base type
• See Supported Query Filter Tuple Elements for acceptable values.
|
Result (invalid query parameter)
|
Error message stating invalid query.
|
Result (valid query parameter)
|
Number
|
|
These element types are case sensitive.
|
Field Name (Element Type)
|
Type
|
ValueType
|
Description
|
Example Value(s)
|
JSON Examples
|
||
---|---|---|---|---|---|---|---|
entityNameMask
|
LIKE
|
STRING
|
• Optional field. The entityNameMask is a name of an implicit field.
• Its value type must be a STRING that contains the name of the entity as the value to select only records in the property_vtq that is LIKE the value specified.
|
• *
• Thing1
• *hing1*
|
{ "fieldName": "entityNameMask", "type": "LIKE", "value", "*" }
{ "fieldName": "entityNameMask", "type": "LIKE", "value", "Thing1" }
{ "fieldName": "entityNameMask", "type": "LIKE", "value", "*hing1*" }
|
||
entityTypeMask
|
LIKE
|
STRING
|
• Optional field. The entityTypeMask is a name of an implicit field.
• Its value type must be a STRING that contains the type of the entity as the value to select only records in the property_vtq that is LIKE the value specified.
|
• *
• Thing
• *hin*
|
{ "fieldName": "entityTypeMask", "type": "LIKE", "value", "*" }
{ "fieldName": "entityTypeMask", "type": "LIKE", "value", "Thing" }
{ "fieldName": "entityTypeMask", "type": "LIKE", "value", "*Thin*" }
|
||
propertyNameMask
|
LIKE
|
STRING
|
• Optional field. The propertyNameMask is a name of an implicit field.
• Its value type must be a STRING that contains the name of the property that as the value to select only records in the property_vtq that is LIKE the value specified.
|
• *
• prop1
• *rop1*
• *erialNumber
• model*umbe*
|
{ "fieldName": "propertyNameMask", "type": "LIKE", "value", "*" }
{ "fieldName": "propertyNameMask", "type": "LIKE", "value", "prop1" }
{ "fieldName": "propertyNameMask", "type": "LIKE", "value", "*rop1*" }
{ "fieldName": "propertyNameMask", "type": "LIKE", "value", "*erialNumber" }
{ "fieldName": "propertyNameMask", "type": "LIKE", "value", "model*umbe" }
|
||
propertyBaseType
|
LIKE
|
STRING
|
• Optional field. The propertyBasetype is a name of an implicit field.
• Its value type must be a STRING that contains the name of a valid base type as the value to select only records in the property_vtq that is LIKE the value specified.
• If propertyIsIndexed is true, then the propertyBaseType value must be a valid indexable base type friendly name of one of the following:
◦ STRING
◦ NUMBER
◦ INTEGER
◦ LONG
◦ BOOLEAN
◦ DATETIME
◦ THINGNAME
◦ USERNAME
◦ GROUPNAME
◦ HYPERLINK
◦ MASHUPNAME
◦ MENUNAME
◦ DASHBOARDNAME
◦ TEXT
◦ GUID
◦ NOTIFICATIONCONTENTNAME
◦ NOTIFICATIONDEFINITIONNAME
◦ STYLETHEMENAME
◦ THINGGROUPNAME
• If propertyIsIndexed is false, then one of the following can be specified:
◦ PASSWORD
◦ INFOTABLE
◦ LOCATION
◦ IMAGE
◦ XML
◦ JSON
◦ QUERY
◦ HTML
◦ BLOB
◦ VEC2
◦ VEC3
◦ VEC4
◦ THINGCODE
|
• thingname
• thingNaMe
• THINGNAME
• THINGNamE
• String
• STRING
• BOOLean
• Boolean
• veC2
|
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "thingname" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "thingNaMe" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "THINGNAME" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "THINGNamE" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "String" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "STRING" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "BOOLean" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "Boolean" }
{ "fieldName": "propertyBaseType", "type": "LIKE", "value", "veC2" }
|
||
propertyIsIndexed
|
EQ
|
BOOLEAN
|
• Optional field. The propertyIsIndexed is a name of an implicit field.
• Its value type must be a valid BOOLEAN value that is used to filter indexed and unindexed properties in the property_vtq that is EQ the value specified.
• Valid values are true and false.
|
• true
• false
|
{ "fieldName": "propertyIsIndexed", "type": "EQ", "value", true}
{ "fieldName": "propertyIsIndexed", "type": "EQ", "value", false}
|
What
|
Why
|
GetPropertyVTQCount Query JSON Example
|
---|---|---|
Determine the number of properties in the ThingWorx platform run time that contain an indexed ThingName value.
|
You are looking for how many times a Thing (Thing1) is specified in any ( * ) Thing property to determine how many times it is used within the custom application model within the platform. This may be the case for a more optimized Where Used query on properties' functionality that could be provided as the query parameter input to the QueryImplementingThingOptimized service:
{
"filters": { "fieldName": "*", "type": "LIKE", "value": "Thing1" } } |
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "ThingName" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": true } ], "type": "AND" }, "type": "SELF" } |
Determine the number of properties (and thus Things) in the ThingWorx platform run time that contain a model number of B-X42 that is not indexed and has a STRING base type.
|
You want to know how many batteries that are modeled as Things in your platform are of the new B-X42 battery type based on the model number.
{
"filters": { "fieldName": "modelNumber", "type": "LIKE", "value": "B-X42" } } |
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "String" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": false }, { "fieldName": "propertyNameMask", "type": "LIKE", "value": "B-X42" } ], "type": "AND" }, "type": "SELF" } |
Determine the number of properties (and thus Things) in the ThingWorx platform run time that contain a model number that is for a B-X* that is indexed and has a STRING base type.
|
You want to know how many batteries that are modeled as Things in your platform are of the battery type but don’t care about the specific model number (i.e. 1, 2, 3,41, 43, etc).
{
"filters": { "fieldName": "modelNumber", "type": "LIKE", "value": "B-X*" } } |
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "String" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": true }, { "fieldName": "propertyNameMask", "type": "LIKE", "value": "B-X*" } ], "type": "AND" }, "type": "SELF" } |
Invalid Query
|
Example that will Cause an Error Result
|
||
---|---|---|---|
Filter tuple fields that specify OR filter collections.
|
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "String" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": true } ], "type": "OR" }, "type": "SELF" } |
||
One of the five element types as field names occur more than once.
|
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "String" }, { "fieldName": "propertyBaseType", "type": "LIKE", "value": "Long" } ], "type": "AND" }, "type": "SELF" } |
||
Invalid values for propertyBaseType.
|
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "InvalidType" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": true } ], "type": "AND" }, "type": "SELF" } |
||
Invalid values for fieldName.
|
{
"filters": { "filters": [ { "fieldName": "invalidFieldName", "type": "LIKE", "value": "*" } ], "type": "AND" }, "type": "SELF" } |