Cypher II (clause)

Source: Internet
Author: User
Tags neo4j

General
    1. Return

      1. As Change column name
      2. return DISTINCT B (return not duplicated)
    2. ORDER BY

      1. Default Ascending (desc reverse order)
      2. Sort in ascending order null at the end, reverse null at the top
    3. Limit

      1. LIMIT toInt(3 * rand())+ 1It can also be an expression
    4. Skip
    5. With




    6. Unwind (expand)

      1. UNWIND[1,2,3] AS x
        RETURN x
      2. WITH [1,1,2,2] AS coll UNWIND coll AS x
        WITH DISTINCT x
        RETURN collect(x) AS SET

    7. Union

      1. UNION ALL evaluates the result and operations
      2. Union to the result to go heavy
    8. Using

      1. Force a start point USING INDEX

Reading
    1. Match

      1. --Querying all related nodes (skipping relationships), ignoring types and orientations
      2. There are special characters such as spaces in the relationship, then the ` (backtick) reference
      3. Variable length path with attribute match
      4. id(r)=0ID (node or relationship), the equals sign is a single equals sign
      5. Single Shortest Path

        All shortest paths (equal length)
    2. Creating nodes and relationships
      create (n1{num:1}),(n2{num:2}),...//这里n是变量名
      create (n1)-[:rel]->(n2) //rel表示某种关系

    3. deleting nodes and relationships
      delete nIf the node is deleted, only the node is deleted and the relationship is not deleted, so ensure that the relationship has been deleted and the node is deleted
    4. Show all nodes and relationships
      start n=node(*),r=relationship(*)
      return n,r
Check Match Index
    1. Configuration
      First, configure it in Neo4j.properties.
    2. Set up on the console page of the neo4j
      (1) index --create node_auto_index -t Node
      (2) index --indexes
      (3) Final effect:

Cypher II (clause)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.