詳細資訊
|
|
---|---|
描述
|
傳回由查詢條件指定的內容計數。
|
參數
|
query
• 查詢基礎類型
• 請參閱支援的查詢篩選器元組元素以取得可接受值。
|
結果 (無效查詢參數)
|
指出無效查詢的錯誤訊息。
|
結果 (有效查詢參數)
|
數值
|
![]() |
這些元素類型區分大小寫。
|
欄位名稱 (元素類型)
|
類型
|
ValueType
|
描述
|
範例值
|
JSON 範例
|
||
---|---|---|---|---|---|---|---|
entityNameMask
|
LIKE
|
STRING
|
• 選用欄位。entityNameMask 是隱含欄位的名稱。
• 其值類型必須是包含實體名稱的 STRING,因為值只會在 LIKE 所指定 value 的 property_vtq 中選取記錄。
|
• *
• Thing1
• *hing1*
|
{ "fieldName": "entityNameMask", "type": "LIKE", "value", "*" }
{ "fieldName": "entityNameMask", "type": "LIKE", "value", "Thing1" }
{ "fieldName": "entityNameMask", "type": "LIKE", "value", "*hing1*" }
|
||
entityTypeMask
|
LIKE
|
STRING
|
• 選用欄位。entityTypeMask 是隱含欄位的名稱。
• 其值類型必須是包含實體類型的 STRING,因為值只會在 LIKE 所指定 value 的 property_vtq 中選取記錄。
|
• *
• Thing
• *hin*
|
{ "fieldName": "entityTypeMask", "type": "LIKE", "value", "*" }
{ "fieldName": "entityTypeMask", "type": "LIKE", "value", "Thing" }
{ "fieldName": "entityTypeMask", "type": "LIKE", "value", "*Thin*" }
|
||
propertyNameMask
|
LIKE
|
STRING
|
• 選用欄位。propertyNameMask 是隱含欄位的名稱。
• 其值類型必須是包含內容名稱的 STRING,因為值只會在 LIKE 所指定 value 的 property_vtq 中選取記錄。
|
• *
• 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
|
• 選用欄位。propertyBasetype 是隱含欄位的名稱。
• 其值類型必須是包含有效基礎類型名稱的 STRING,因為值只會在 LIKE 所指定值的property_vtq 中選取記錄。
• 如果 propertyIsIndexed 為 true,則 propertyBaseType 值必須是下列其中一項有效的可供索引基礎類型易記名稱:
◦ STRING
◦ NUMBER
◦ INTEGER
◦ LONG
◦ BOOLEAN
◦ DATETIME
◦ THINGNAME
◦ USERNAME
◦ GROUPNAME
◦ HYPERLINK
◦ MASHUPNAME
◦ MENUNAME
◦ DASHBOARDNAME
◦ TEXT
◦ GUID
◦ NOTIFICATIONCONTENTNAME
◦ NOTIFICATIONDEFINITIONNAME
◦ STYLETHEMENAME
◦ THINGGROUPNAME
• 如果 propertyIsIndexed 為 false,則可指定下列其中一項:
◦ PASSWORD
◦ INFOTABLE
◦ LOCATION
◦ IMAGE
◦ XML
◦ JSON
◦ QUERY
◦ HTML
◦ BLOB
◦ VEC2
◦ VEC3
◦ VEC4
◦ THINGCODE
|
• thingname
• thingNaMe
• THINGNAME
• THINGNamE
• 字串
• 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
|
• 選用欄位。propertyIsIndexed 是隱含欄位的名稱。
• 其值類型必須是有效 BOOLEAN 值,且用於在 EQ 所指定值的 property_vtq 中篩選索引及取消索引的內容。
• 有效值為 true 和 false。
|
• true
• false
|
{ "fieldName": "propertyIsIndexed", "type": "EQ", "value", true}
{ "fieldName": "propertyIsIndexed", "type": "EQ", "value", false}
|
內容
|
原因
|
GetPropertyVTQCount 查詢 JSON 範例
|
---|---|---|
決定在 ThingWorx Platform 執行時間中包含索引 ThingName 值的內容數。
|
您會尋找在任何 ( * ) 物件內容中指定物件 (Thing1) 多少次以決定其在平台內的自訂應用程式模型中使用多少次。對於在可提供作為輸入至 QueryImplementingThingOptimized 服務之查詢參數的內容功能,這可能是更佳 "Where Used" 查詢:
{
"filters": { "fieldName": "*", "type": "LIKE", "value": "Thing1" } } |
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "ThingName" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": true } ], "type": "AND" }, "type": "SELF" } |
決定在 ThingWorx Platform 執行時間中包含未索引且具有 STRING 基礎類型之 B-X42 模型數的內容數 (及物件數)。
|
您想要知道在您的平台中有多少電池被建模為物件,而且根據型號屬於新的 B-X42 電池類型。
{
"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" } |
決定在 ThingWorx Platform 執行時間中包含已索引且具有 STRING 基礎類型之 B-X* 模型數的內容數 (及物件數)。
|
您想要知道在您的平台中有多少電池被建模為物件,而且屬於電池類型,但特定型號 (即 1、2、3、41、43 等) 是什麼並沒有區別。
{
"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" } |
無效查詢
|
將導致錯誤結果的範例
|
||
---|---|---|---|
指定 OR 篩選器集合的篩選器元組欄位。
|
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "String" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": true } ], "type": "OR" }, "type": "SELF" } |
||
五個元素類型中的其中一個,因為欄位名稱出現不止一次。
|
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "String" }, { "fieldName": "propertyBaseType", "type": "LIKE", "value": "Long" } ], "type": "AND" }, "type": "SELF" } |
||
propertyBaseType 的無效值。
|
{
"filters": { "filters": [ { "fieldName": "propertyBaseType", "type": "LIKE", "value": "InvalidType" }, { "fieldName": "propertyIsIndexed", "type": "EQ", "value": true } ], "type": "AND" }, "type": "SELF" } |
||
fieldName 的無效值。
|
{
"filters": { "filters": [ { "fieldName": "invalidFieldName", "type": "LIKE", "value": "*" } ], "type": "AND" }, "type": "SELF" } |