You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "waleedahmed0001 (via GitHub)" <gi...@apache.org> on 2023/06/17 10:00:51 UTC

[GitHub] [age] waleedahmed0001 commented on issue #993: Graph traversal optimization by excluding graph path (stop conditions)

waleedahmed0001 commented on issue #993:
URL: https://github.com/apache/age/issues/993#issuecomment-1595697806

   The syntax of exist clause is mentioned below:
   
   **Syntax:**
   exists(property)
   
   Returns:
   An agtype boolean
   
   Arguments:
   property | A property from a vertex or edge
   
   A query using the exist is mentioned below:
   
   ```
   SELECT *
   FROM cypher('graph_name', $$
        MATCH (n)
        WHERE exists(n.surname)
        RETURN n.first_name, n.last_name
   $$) as (first_name agtype, last_name agtype);
   ```
   
   **Exists(Path)**
   EXISTS(path) returns true if for the given path, there already exists the given path.
   
   ```
   SELECT *
   FROM cypher('graph_name', $$
        MATCH (n)
        WHERE exists((n)-[]-({name: 'Willem Defoe'}))
        RETURN n.full_name
   $$) as (full_name agtype);
   ```
   
   You can get more help from this [documentation](https://age.apache.org/age-manual/master/functions/predicate_functions.html#exists-path)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org