Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:42:01+00:00 2026-06-05T06:42:01+00:00

I have the following data: A –> B B –> C Consider this query:

  • 0

I have the following data:

A --> B
B --> C

Consider this query:

START n = node(A, B)
MATCH p = n-[*..2]-(x)
RETURN n.Name, x.Name, length(p)

Starting with 2 input nodes, traverse to other nodes with no more than 2 hops.

The following is returned:

==> +------------------------------------------------+
==> | n.Name       | x.Name              | length(p) |
==> +------------------------------------------------+
==> | "A"          | "C"                 | 2         |
==> | "B"          | "C"                 | 1         |

Backstory: In my app you can search for interests (multiple at a time). Each interest can have related interests. Sometimes the input interests share common interests which results in duplicated interests.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:42:02+00:00Added an answer on June 5, 2026 at 6:42 am

    It looks like simply calling MIN does what I’m looking for:

    RETURN x.Name, min(length(p))
    

    So it’s going to group by x.Name and take the smallest hop column.

    http://docs.neo4j.org/chunked/stable/query-aggregation.html

    Aggregation can be done over all the matching sub graphs, or it can be
    further divided by introducing key values. These are non-aggregate
    expressions, that are used to group the values going into the
    aggregate functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data stored in string ; string name = gokera atoram
I have following CSV data: 10,11,12.34 I can parse this using CSV from the
Let's say I have following data: Name Priority A 3 A 5 B 1
I have the following data on one line: <a href=#page-metadata-start class=assistive>Go to start of
I have the following data in a dictionary: {'323503': [{'name': 'Derek', 'age': '21', 'race':
I have this following data source binding: MembershipProvider provider = new MembershipProvider(); UserUpdateLogs userUpdateLogs
I have the following data as input (sorted by first column): foo 1 2
I have the following data that looks like this for example: 34 foo 34
I have the following data. I need to query the data so that I
I have the following data set which shows the start and the end of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.