Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question about schema functions:type() #4924

Open
1260328762 opened this issue Nov 23, 2022 · 1 comment
Open

A question about schema functions:type() #4924

1260328762 opened this issue Nov 23, 2022 · 1 comment
Labels
type/question Type: question about the product

Comments

@1260328762
Copy link

1260328762 commented Nov 23, 2022

I have a problem when I use type() function with openCypher

This is my statement
match p=(a)-[e*..2]->(b) where id(a) == '123456' return p

I want to use type() function to exclude specified edge like this
match p=(a)-[e*..2]->(b) where id(a) == '123456' and type(e) != 'follow' return type(e)

But it didn't work, I used the following statement to see the result
match p=(a)-[e*..2]->(b) where id(a) == '123456' return type(e)
I found that it returned BAD_TYPE,this is the screenshot
image

Then I changed the statement, like this
match p=(a)-[e]->(b) where id(a) == '123456' return type(e)
And it worked, this is the screenshot
image

Is there something wrong with the way I use it or other reasons?

version: 3.1.0

@wey-gu
Copy link
Contributor

wey-gu commented Nov 23, 2022

Good catch, it's because when it's multiple hops of edges, the e variable is a list.

https://docs.nebula-graph.com.cn/3.3.0/3.ngql-guide/7.general-query-statements/2.match/#_12

Screenshot 2022-11-23 at 18 00 29

@Sophie-Xie Sophie-Xie added the type/question Type: question about the product label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question Type: question about the product
Projects
None yet
Development

No branches or pull requests

3 participants