2 Replies Latest reply on Sep 18, 2017 11:42 AM by Thad Esser

    How to show relationship in query

    Thad Esser

      Hi,

       

      Is there a way to show the full relationship (including roles) between two node kinds in a query (not TPL)?

       

      For example, this query returns two hosts related to the Model Definition:

      search ModelDefinition where state = 'published' and not needs_attention and name = 'MyApplication'

      show name, explode #:DefinitionContainment:IncludedItem:Host.name as Host

       

      This query, without the "IncludedItem" role, returns 167 hosts:

      search ModelDefinition where state = 'published' and not needs_attention and name = 'MyApplication'

      show name, explode  #:DefinitionContainment::Host.name as Host

       

      I am curious what other roles are in play and would like to show that in my query results.  I found the hasRelationship() function in the documentation, but that only gives you a T/F value for a relationship you know about.

       

      Thanks,

      Thad