Updating the query to this worked.
SELECT space FROM DIGITALTWINS space JOIN level RELATED space.isPartOf WHERE level.$dtId = 'levelId' AND ( IS_OF_MODEL(space, 'dtmi:example:space:room;1') OR IS_OF_MODEL(space, 'dtmi:example:space:room;2'))
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When I use this query to pull the twins of specific models, the return does not include the $metadata.$model property. This happened all of a sudden, the $model property used to be included on the result.
QUERY:
SELECT space FROM DIGITALTWINS space JOIN level RELATED space.isPartOf WHERE space.$metadata.$model IN [ {list of models here} ] AND level.$dtId = 'levelId'
SAMPLE SPACE OBJECT returned:
{
"space": {
"$metadata": {
"name": {
"lastUpdateTime": ""
},
"externalIds": {
"lastUpdateTime": ""
}
},
"$dtId": "",
"$etag": "",
"name": "",
}
}
Also, I tried using simple queries like
SELECT * FROM DIGITALTWINS T WHERE T.$dtId = 'id'
and $metadata.$model property was there. It seems like the issue is happening only when using JOIN.
UPDATE:
I have a similar branch deployed on 2 different environments. The ADT on the environment deployed on West Europe has this issue, but the one on East US works just fine.
Updating the query to this worked.
SELECT space FROM DIGITALTWINS space JOIN level RELATED space.isPartOf WHERE level.$dtId = 'levelId' AND ( IS_OF_MODEL(space, 'dtmi:example:space:room;1') OR IS_OF_MODEL(space, 'dtmi:example:space:room;2'))
Hello @Ismael Ibuan Thanks for reaching out on this forum,
Have you seen any error messages in the output console window? I tried few queries in ADT-WestEurope and I can see the results, please let me know if you have tried the below queries?
SELECT Floor, Room FROM DIGITALTWINS Floor JOIN Room RELATED Floor.contains WHERE Floor.$dtId = 'Floor1'
SELECT Floor, Room FROM DIGITALTWINS Floor JOIN Room RELATED Floor.contains WHERE Floor.$metadata.$model ='dtmi:example:Floor;1' AND Floor.$dtId = 'Floor0'
SELECT Floor, Room FROM DIGITALTWINS Floor JOIN Room RELATED Floor.contains WHERE Floor.$metadata.$model IN ['dtmi:example:Floor;1','dtmi:example:Floor;0'] AND Floor.$dtId = 'Floor0'