Equals
How to use the Equals operator
The Equals
operator returns the items for which the Equals
condition is satisfied.
Allowed Children
Primitive, Reference, Arithmetical, String Operator and Value Transforms nodes
Requirements
Must have 2 children of the same return type
Return Type
Item Ids Set
Example: Basic structure
{
"type": "Equals",
"properties": {},
"children": [
{
"type": "ItemProperty",
"properties": {
"itemPropertyName": "title"
}
},
{
"type": "String",
"properties": {
"value": ["hello"]
}
}
]
}
Example: Number Equals Query
Find items with an attribute value equal to 5.
{
"type": "Query",
"properties": {
"dodiCode": "designs_exampleJobs",
"attributes": ["all"]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsConeCount"
}
},
{
"type": "Number",
"value": ["5"]
}
]
}
]
}
Example: DateTime Equals Query
Find items with a specific Date and Time.
{
"type": "Query",
"properties": {
"dodiCode": "designs_exampleJobs",
"attributes": ["all"]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsCompletedDate"
}
},
{
"type": "DateTime",
"value": ["2019-05-08T14:10:38Z"]
}
]
}
]
}
Example: Time Equals Query
Find items with a specific Time. The time needs to be a valid DateTime but with the date component set to the Unix Epoch
{
"type": "Query",
"properties": {
"dodiCode": "designs_exampleJobs",
"attributes": ["all"]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsSomeTime"
}
},
{
"type": "Time",
"value": ["1970-01-01T13:23:20Z"]
}
]
}
]
}
Example: Seasonal Equals Query
Find items with a specific Seasonal. The seasonal needs to be a valid DateTime but with the date component set to the Unix Epoch plus 2 years (since it is a leap year)
{
"type": "Query",
"properties": {
"dodiCode": "designs_exampleJobs",
"attributes": ["all"]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsSomeSeasonal"
}
},
{
"type": "Seasonal",
"value": ["1972-01-01T13:23:20Z"]
}
]
}
]
}
Example: Date Equals Query
Find the tress installed on either of 2 dates.
{
"type": "Query",
"properties": {
"dodiCode": "designInterfaces_trees"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_treesInstalledDate"
}
},
{
"type": "Date",
"value": ["2019-05-08", "2019-05-07"]
}
]
}
]
}
Example: String Or Equals Query
Find items with a attribute (attributes_welcomesName) value equal to "Hello" or "Hi".
{
"type": "Query",
"properties": {
"dodiCode": "designs_welcomes",
"attributes": ["attributes_welcomesName"]
},
"children": [
{
"type": "Or",
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_welcomesName"
}
},
{
"type": "String",
"value": ["Hello"]
}
]
},
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_welcomesName"
}
},
{
"type": "String",
"value": ["Hi"]
}
]
}
]
}
]
}
Example: Boolean Equals Query
{
"type": "Query",
"properties": {
"dodiCode": "designInterfaces_trees"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_treesIsStaked"
}
},
{
"type": "Boolean",
"value": "true"
}
]
}
]
}