Skip to content

SQL Find References

lvca edited this page Dec 22, 2012 · 1 revision

SQL Find References

SQL command to search all records that contains a link to a given record id in the entire database or a subset of specified class and cluster. Returns a set of record ids.

Syntax =

{{{FIND REFERENCES <rid|()> [- rid as the record id to search. If a sub-query is passed, then all the RIDs returned by the sub-query will be searched. Sub-query is available since 1.0rc9

  • class-list list of specific class or cluster, separated by commas, you want to execute the search in.

Returns a list of document containing 2 fields:

  • rid, as the original RID searched
  • referredBy, as a Set of RIDs containing the collection of RID that reference the searched rid if any, otherwise the set is empty

Examples

Get all the records that contains a link to 5:0

    find references 5:0

Result example:

e11b22bc97654bd9250605e6299ef075

Get all the references to the record of the default cluster (available since 1.0rc9):

86b4966dd760d0cb7d13ba2684ded8e5

Get all the records in Profile and !AnimalType classes that contains a link to 5:0 :

9119a50321865bacafbfedc34531a81a

Get all the records in Profile cluster and !AnimalType class that contains a link to 5:0

    find references 5:0 [cluster:Profile,AnimalType]

To know more about other SQL commands look at SQL SQL commands.

Clone this wiki locally