my parameter map is not recognized in neo4j cypher
This question is different in that it is more pointed. The previous question though related had other issues including the apoc implementation. Also the answer was not clear.
I have a parameter map paramObj (from console.log)
{"email":"xyz@abc.com","password":"password123","category":"Owner","name":"Michael""paramVehicles":["Honda","Chevrolet","BMW"],"paramVehicleProps":}
and a cypher query queryDB (from console.log)
CREATE (user:Person:Owner {email: $email})
SET user.name = $name, user.password = $password
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
with a session .run(queryDB,paramObj).then.... which works fine. However when I tried to use the paramObj in a SET += $paramObj I get an error
CREATE (user:Person:Owner {email: $email})
SET user += $paramObj
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
Error: {"code":"Neo.ClientError.Statement.ParameterMissing","name":"Neo4jError"}
Other combinations such as SET += paramObj or SET += {paramObj} results in the same error or syntax error. I am using neo4j 3.4.5 with nodejs running on the Neo4j Desktop. This error doesn't occur in the browser only in code. What am I missing here?
node.js neo4j cypher
|
show 1 more comment
This question is different in that it is more pointed. The previous question though related had other issues including the apoc implementation. Also the answer was not clear.
I have a parameter map paramObj (from console.log)
{"email":"xyz@abc.com","password":"password123","category":"Owner","name":"Michael""paramVehicles":["Honda","Chevrolet","BMW"],"paramVehicleProps":}
and a cypher query queryDB (from console.log)
CREATE (user:Person:Owner {email: $email})
SET user.name = $name, user.password = $password
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
with a session .run(queryDB,paramObj).then.... which works fine. However when I tried to use the paramObj in a SET += $paramObj I get an error
CREATE (user:Person:Owner {email: $email})
SET user += $paramObj
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
Error: {"code":"Neo.ClientError.Statement.ParameterMissing","name":"Neo4jError"}
Other combinations such as SET += paramObj or SET += {paramObj} results in the same error or syntax error. I am using neo4j 3.4.5 with nodejs running on the Neo4j Desktop. This error doesn't occur in the browser only in code. What am I missing here?
node.js neo4j cypher
Possible duplicate of Neo4j cypher query fails with unknown syntax error
– InverseFalcon
Nov 24 '18 at 20:08
I believe you already asked this one. As previously answered,paramObjis not a key in your parameters map, it's the variable you're using in the javascript code to pass the parameter map to be executed by Neo4j, that parameter name will not be able to be referenced by Cypher. If you want to do this sort of thing, you need to explicitly haveparamObjas a key in the map that you pass in.
– InverseFalcon
Nov 24 '18 at 20:11
The reason why it probably worked in the browser was you likely set aparamObjparameter.
– InverseFalcon
Nov 24 '18 at 20:12
@inverseFalcon....the question maybe similar but I still don't have an answer could you please give an example of your explanation. I should also note that I had this format .run(querydb, {paramObj: paramObj} ).then and I got the same errors.
– MichaelE
Nov 24 '18 at 21:17
1
That's different than what you had in your description. Usingsession.run(querydb, {paramObj: paramObj} )should have worked, asparamObjwould have then been a key in the parameter map you passed in, and should be referenceable in the Cypher query with$paramObj. Note that since you added level of nesting, you would have to reference your other parameters accordingly, as they're now properties of the nested paramObj. For example, sinceemailis now a property of theparamObj, you would reference it in your query like:$paramObj.email
– InverseFalcon
Nov 24 '18 at 21:20
|
show 1 more comment
This question is different in that it is more pointed. The previous question though related had other issues including the apoc implementation. Also the answer was not clear.
I have a parameter map paramObj (from console.log)
{"email":"xyz@abc.com","password":"password123","category":"Owner","name":"Michael""paramVehicles":["Honda","Chevrolet","BMW"],"paramVehicleProps":}
and a cypher query queryDB (from console.log)
CREATE (user:Person:Owner {email: $email})
SET user.name = $name, user.password = $password
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
with a session .run(queryDB,paramObj).then.... which works fine. However when I tried to use the paramObj in a SET += $paramObj I get an error
CREATE (user:Person:Owner {email: $email})
SET user += $paramObj
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
Error: {"code":"Neo.ClientError.Statement.ParameterMissing","name":"Neo4jError"}
Other combinations such as SET += paramObj or SET += {paramObj} results in the same error or syntax error. I am using neo4j 3.4.5 with nodejs running on the Neo4j Desktop. This error doesn't occur in the browser only in code. What am I missing here?
node.js neo4j cypher
This question is different in that it is more pointed. The previous question though related had other issues including the apoc implementation. Also the answer was not clear.
I have a parameter map paramObj (from console.log)
{"email":"xyz@abc.com","password":"password123","category":"Owner","name":"Michael""paramVehicles":["Honda","Chevrolet","BMW"],"paramVehicleProps":}
and a cypher query queryDB (from console.log)
CREATE (user:Person:Owner {email: $email})
SET user.name = $name, user.password = $password
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
with a session .run(queryDB,paramObj).then.... which works fine. However when I tried to use the paramObj in a SET += $paramObj I get an error
CREATE (user:Person:Owner {email: $email})
SET user += $paramObj
WITH user, $paramVehicles AS vehicles
UNWIND vehicles AS vehicle
MATCH(v:Vehicles {name:vehicle})
MERGE (user)-[r:OWNS {since: timestamp()}]->(v)
RETURN user,r,v
Error: {"code":"Neo.ClientError.Statement.ParameterMissing","name":"Neo4jError"}
Other combinations such as SET += paramObj or SET += {paramObj} results in the same error or syntax error. I am using neo4j 3.4.5 with nodejs running on the Neo4j Desktop. This error doesn't occur in the browser only in code. What am I missing here?
node.js neo4j cypher
node.js neo4j cypher
edited Nov 24 '18 at 22:32
MichaelE
asked Nov 24 '18 at 17:41
MichaelEMichaelE
242114
242114
Possible duplicate of Neo4j cypher query fails with unknown syntax error
– InverseFalcon
Nov 24 '18 at 20:08
I believe you already asked this one. As previously answered,paramObjis not a key in your parameters map, it's the variable you're using in the javascript code to pass the parameter map to be executed by Neo4j, that parameter name will not be able to be referenced by Cypher. If you want to do this sort of thing, you need to explicitly haveparamObjas a key in the map that you pass in.
– InverseFalcon
Nov 24 '18 at 20:11
The reason why it probably worked in the browser was you likely set aparamObjparameter.
– InverseFalcon
Nov 24 '18 at 20:12
@inverseFalcon....the question maybe similar but I still don't have an answer could you please give an example of your explanation. I should also note that I had this format .run(querydb, {paramObj: paramObj} ).then and I got the same errors.
– MichaelE
Nov 24 '18 at 21:17
1
That's different than what you had in your description. Usingsession.run(querydb, {paramObj: paramObj} )should have worked, asparamObjwould have then been a key in the parameter map you passed in, and should be referenceable in the Cypher query with$paramObj. Note that since you added level of nesting, you would have to reference your other parameters accordingly, as they're now properties of the nested paramObj. For example, sinceemailis now a property of theparamObj, you would reference it in your query like:$paramObj.email
– InverseFalcon
Nov 24 '18 at 21:20
|
show 1 more comment
Possible duplicate of Neo4j cypher query fails with unknown syntax error
– InverseFalcon
Nov 24 '18 at 20:08
I believe you already asked this one. As previously answered,paramObjis not a key in your parameters map, it's the variable you're using in the javascript code to pass the parameter map to be executed by Neo4j, that parameter name will not be able to be referenced by Cypher. If you want to do this sort of thing, you need to explicitly haveparamObjas a key in the map that you pass in.
– InverseFalcon
Nov 24 '18 at 20:11
The reason why it probably worked in the browser was you likely set aparamObjparameter.
– InverseFalcon
Nov 24 '18 at 20:12
@inverseFalcon....the question maybe similar but I still don't have an answer could you please give an example of your explanation. I should also note that I had this format .run(querydb, {paramObj: paramObj} ).then and I got the same errors.
– MichaelE
Nov 24 '18 at 21:17
1
That's different than what you had in your description. Usingsession.run(querydb, {paramObj: paramObj} )should have worked, asparamObjwould have then been a key in the parameter map you passed in, and should be referenceable in the Cypher query with$paramObj. Note that since you added level of nesting, you would have to reference your other parameters accordingly, as they're now properties of the nested paramObj. For example, sinceemailis now a property of theparamObj, you would reference it in your query like:$paramObj.email
– InverseFalcon
Nov 24 '18 at 21:20
Possible duplicate of Neo4j cypher query fails with unknown syntax error
– InverseFalcon
Nov 24 '18 at 20:08
Possible duplicate of Neo4j cypher query fails with unknown syntax error
– InverseFalcon
Nov 24 '18 at 20:08
I believe you already asked this one. As previously answered,
paramObj is not a key in your parameters map, it's the variable you're using in the javascript code to pass the parameter map to be executed by Neo4j, that parameter name will not be able to be referenced by Cypher. If you want to do this sort of thing, you need to explicitly have paramObj as a key in the map that you pass in.– InverseFalcon
Nov 24 '18 at 20:11
I believe you already asked this one. As previously answered,
paramObj is not a key in your parameters map, it's the variable you're using in the javascript code to pass the parameter map to be executed by Neo4j, that parameter name will not be able to be referenced by Cypher. If you want to do this sort of thing, you need to explicitly have paramObj as a key in the map that you pass in.– InverseFalcon
Nov 24 '18 at 20:11
The reason why it probably worked in the browser was you likely set a
paramObj parameter.– InverseFalcon
Nov 24 '18 at 20:12
The reason why it probably worked in the browser was you likely set a
paramObj parameter.– InverseFalcon
Nov 24 '18 at 20:12
@inverseFalcon....the question maybe similar but I still don't have an answer could you please give an example of your explanation. I should also note that I had this format .run(querydb, {paramObj: paramObj} ).then and I got the same errors.
– MichaelE
Nov 24 '18 at 21:17
@inverseFalcon....the question maybe similar but I still don't have an answer could you please give an example of your explanation. I should also note that I had this format .run(querydb, {paramObj: paramObj} ).then and I got the same errors.
– MichaelE
Nov 24 '18 at 21:17
1
1
That's different than what you had in your description. Using
session.run(querydb, {paramObj: paramObj} ) should have worked, as paramObj would have then been a key in the parameter map you passed in, and should be referenceable in the Cypher query with $paramObj. Note that since you added level of nesting, you would have to reference your other parameters accordingly, as they're now properties of the nested paramObj. For example, since email is now a property of the paramObj, you would reference it in your query like: $paramObj.email– InverseFalcon
Nov 24 '18 at 21:20
That's different than what you had in your description. Using
session.run(querydb, {paramObj: paramObj} ) should have worked, as paramObj would have then been a key in the parameter map you passed in, and should be referenceable in the Cypher query with $paramObj. Note that since you added level of nesting, you would have to reference your other parameters accordingly, as they're now properties of the nested paramObj. For example, since email is now a property of the paramObj, you would reference it in your query like: $paramObj.email– InverseFalcon
Nov 24 '18 at 21:20
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53460799%2fmy-parameter-map-is-not-recognized-in-neo4j-cypher%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53460799%2fmy-parameter-map-is-not-recognized-in-neo4j-cypher%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible duplicate of Neo4j cypher query fails with unknown syntax error
– InverseFalcon
Nov 24 '18 at 20:08
I believe you already asked this one. As previously answered,
paramObjis not a key in your parameters map, it's the variable you're using in the javascript code to pass the parameter map to be executed by Neo4j, that parameter name will not be able to be referenced by Cypher. If you want to do this sort of thing, you need to explicitly haveparamObjas a key in the map that you pass in.– InverseFalcon
Nov 24 '18 at 20:11
The reason why it probably worked in the browser was you likely set a
paramObjparameter.– InverseFalcon
Nov 24 '18 at 20:12
@inverseFalcon....the question maybe similar but I still don't have an answer could you please give an example of your explanation. I should also note that I had this format .run(querydb, {paramObj: paramObj} ).then and I got the same errors.
– MichaelE
Nov 24 '18 at 21:17
1
That's different than what you had in your description. Using
session.run(querydb, {paramObj: paramObj} )should have worked, asparamObjwould have then been a key in the parameter map you passed in, and should be referenceable in the Cypher query with$paramObj. Note that since you added level of nesting, you would have to reference your other parameters accordingly, as they're now properties of the nested paramObj. For example, sinceemailis now a property of theparamObj, you would reference it in your query like:$paramObj.email– InverseFalcon
Nov 24 '18 at 21:20