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.

Trouble with apoc.load.jsonParams

ycot
Node Link

Hello!

I'm trying to use apoc.load.jsonParams with headers parameters.

I've a problem with this statement :

WITH 'https://myurl' AS uri
CALL apoc.load.jsonParams(uri, {access-username:  'xxxxxxxxxx', access-password: 'yyyyyyyy'}, null)
YIELD value
RETURN value

I get this error :

Neo.ClientError.Statement.SyntaxError: Invalid input '-': expected an identifier character, whitespace, '}' or ':' (line 2, column 34 (offset: 128))
"CALL apoc.load.jsonParams(uri, {access-username:  'xxxxxxxxxx', access-password: 'yyyyyyyyy'}, null)"

There is a solution to use key containing "-" ?
The API I try to call is not modifiable..

By advance, thanks you!

1 ACCEPTED SOLUTION

Map keys containing "special" characters (e.g. -, space, umlauts...) need to be quoted into backticks:

return {`access-username`: "abc"}

View solution in original post

2 REPLIES 2

Map keys containing "special" characters (e.g. -, space, umlauts...) need to be quoted into backticks:

return {`access-username`: "abc"}

ycot
Node Link

Thanks you! It works