I'm trying to create a node but having trouble with the spaces - what should I do to resolve - its not clear what should have quotes. It loads fine if there is a single word for the node name?
CREATE (n:Air Plenum {id: '1', name: "Air Plenum", parent: 'hvac-Equipment', alternative: 'None', description: 'A component of the HVAC that receives air from the air handling unit or room to distribute or exhaust to or from the building.'})
You are correct. Here is the full query updated. It now executes:
CREATE (n:`Air Plenum` {id: '1', name: "Air Plenum", parent: 'hvac-Equipment', alternative: 'None', description: 'A component of the HVAC that receives air from the air handling unit or room to distribute or exhaust to or from the building.'})
The back tick is need to enclose node kabeks, relationship types, node property names, or aliases if you want to include a space in any of those. String literals, such as you have for the value of property ‘name’ can be enclosed in either double or single quotes.
Thanks. What is a back tick - I'm not clear on where its meant to go?
CREATE (n:Air Plenum {id: '1', name: "Air Plenum", parent: 'hvac-Equipment', alternative: 'None', description: 'A component of the HVAC that receives air from the air handling unit or room to distribute or exhaust to or from the building.'})
The label is being used in another app where you want to run your query? If so, it looks like it is already been used. You can either run a script to change all the labels, or continue to use it with the space. You will need to enclose it in back ticks. The same is true if you have property keys with spaces, or you want to alias a value with a string with spaces.
Your label has a space. You can enclose it in back ticks to retain the space, but I recommend not using spaces. Instead, remove the space or replace with an underscore, with preference to removing the space.
Thanks. when I run a query against the label from another app will it need to include the underscore or if I remove the space will it still retrieve it as I'd rather avoid having to do that additional step prior to submitting the query?