我需要能夠在neo4j中創建或更新節點。我正在使用節點js。如何在nodejs中構造傳遞參數的密碼查詢
我想用參數來完成這個。
我需要構造一個暗號查詢作爲..
MERGE (user:Person:User {email: {props}.email})
ON CREATE user = {props} SET user.created = timestamp()
ON MATCH SET user.lastSeen = timestamp()
RETURN user'
我已經構造出查詢參數的節點..
node={props:{name:'shekar',email:'[email protected]',age:10}}
如何構建CYPHER查詢?
我想構建這樣的暗號..
cypherQuery='MERGE (user:Person:User {email: ' + node.props.email + '})
ON CREATE user = ' + node.props + ' SET user.created = timestamp()
ON MATCH SET user.lastSeen = timestamp()
RETURN user';
我得到這個錯誤:
errorError: Invalid input '@': expected an identifier character, node labels, a property map, a relationship pattern, '(', '.', '[', "=~", IN, IS, '*', '/', '%', '^', '+', '-', '<', '>', "<=", ">=", '=', "<>", "!=", AND, XOR, OR, ',' or '}' (line 1, column 40)
"MERGE (user:Person:User {email: [email protected]}) ON CREATE user = [object Object] SET user.created = timestamp() ON MATCH SET user.lastSeen = timestamp() RETURN user"
- 協噶爾
整個Neo4j網站似乎最近都在改組。許多博客和SO帖子上的鏈接斷開。 –