cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Aliases - https://neo4j.com/graphacademy/online-training/introduction-to-neo4j/part-4/

Hello,

When using SIngle quote character or double-quote character for aliases, I get the below error. But on the online training page 'Cypher' under the category 'Specifying aliases', it is mentioned that we can use a single quote or double quote. Also, I believe the instructor has used a single-quote character in the video (unless it is backtick)

Error:

Neo.ClientError.Statement.SyntaxError: Invalid input '"': expected whitespace, comment or a variable (line 1, column 95 (offset: 94))

"MATCH (m:Movie {released:2006}) return m.title as Title, m.tagline as Tagline, m.released as "Released""

Many Thanks,
Neel

5 REPLIES 5

Hello Neelkanth,

You must use a backtic character for aliases that contain spaces.

With respect to values for properties, you can use either a single quote or a double quote.

Elaine

Thanks, Elaine

But what if the aliases do not contain spaces, can one use single quote or double quotes then?

Kind regards,
Neel

I believe you just need to put an = sign instead of the AS . I too am new.

Actually that was wrong on my part. I just retyped the part that says MATCH (m:Movie {released:2006}) return m.title as Title, m.tagline as Tagline, m.released as Released and it worked.

Yes, so what I understand is:
1> If aliases contain space use backtick
2> If aliases do not contain space don't use backtick, instead leave as is.

Hence, on the online training webpage, according to me the below text is misguiding. It sounds like if you have space between string use backtick else you can use a single or double quote character (as they say 'rather than').

If you want a heading to contain a space between strings, you must specify the alias with the back tick character, rather than a single or double quote character

Neel

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online