brikteknologier / seraph-model

thin model layer for seraph/neo4j (node.js)
MIT License
111 stars 28 forks source link

Neo4j 3.0 Parentheses sintax error #108

Closed tobiadalsecco closed 8 years ago

tobiadalsecco commented 8 years ago

Running the beer example with Neo4j 3.0.2:

var beer = model(db, "Beer"); var hop = model(db, "Hop");

beer.compose(hop, 'hops', 'contains_hop');

var pliny = { name: 'Pliny the Elder', brewery: 'Russian River', hops: [ { name: 'Columbus', aa: '13' }, { name: 'Simcoe', aa: '12' }, { name: 'Centennial', aa: '8' } ] };

beer.save(pliny, function(err, saved) { console.log(err, saved); });

I got the following error:

{ code: 'Neo.ClientError.Statement.SyntaxError', message: 'Parentheses are required to identify nodes in patterns, i.e. (Beer0) (line 1, column 71 (offset: 70))\n" CREATE (Beer0:Beer),(Hop0:Hop),(Hop1:Hop),(Hop2:Hop) CREATE UNIQUE Beer0-[rel_Hop0:contains_hop]->Hop0,Beer0-[rel_Hop1:contains_hop]->Hop1,Beer0-[rel_Hop2:contains_hop]->Hop2 SET Beer0={Beer0},rel_Hop0={rel_Hop0},Hop0={Hop0},__rel_Hop1={rel_Hop1},Hop1={Hop1},rel_Hop2={__rel_Hop2},Hop2={Hop2} WITH Beer0,Hop0,rel_Hop0,Hop1,rel_Hop1,Hop2,rel_Hop2 OPTIONAL MATCH Beer0-[rel:contains_hop]->target WHERE not (target IN [Beer0,Hop0,Hop1,Hop2]) DELETE rel RETURN Beer0,Hop0,rel_Hop0,Hop1,rel_Hop1,Hop2,__rel_Hop2"\n

shanmarkus commented 8 years ago

i still experience this problem

shanmarkus commented 8 years ago

Unhandled rejection Parentheses are required to identify nodes in patterns, i.e. (pomonaUser0) (line 1, column 71 (offset: 70))

" CREATE (pomonaUser0:pomonaUser),(merchant0:merchant) CREATE UNIQUE pomonaUser0-[rel_merchant0:go_to]->merchant0 SET pomonaUser0={pomonaUser0},rel_merchant0={rel_merchant0},merchant0={merchant0} WITH pomonaUser0,merchant0,__rel_merchant0 OPTIONAL MATCH pomonaUser0-[rel:go_to|check_out]->target WHERE not (target IN [pomonaUser0,merchant0]) DELETE rel RETURN pomonaUser0,merchant0,rel_merchant0"

MintyOrb commented 8 years ago

Also running into this issue.

{ code: 'Neo.ClientError.Statement.SyntaxError',
  message: 'Parentheses are required to identify nodes in patterns, i.e. (Beer0) (line 1, column 71 (offset: 70))\n"   CREATE (Beer0:Beer),(Hop0:Hop),(Hop1:Hop),(Hop2:Hop) CREATE UNIQUE Beer0-[__rel_Hop0:contains_hop]->Hop0,Beer0-[__rel_Hop1:contains_hop]->Hop1,Beer0-[__rel_Hop2:contains_hop]->Hop2 SET Beer0={Beer0},__rel_Hop0={__rel_Hop0},Hop0={Hop0},__rel_Hop1={__rel_Hop1},Hop1={Hop1},__rel_Hop2={__rel_Hop2},Hop2={Hop2} WITH Beer0,Hop0,__rel_Hop0,Hop1,__rel_Hop1,Hop2,__rel_Hop2 OPTIONAL MATCH Beer0-[rel:`contains_hop`]->target WHERE not (target IN [Beer0,Hop0,Hop1,Hop2]) DELETE rel RETURN Beer0,Hop0,__rel_Hop0,Hop1,__rel_Hop1,Hop2,__rel_Hop2"\n       
jonpacker commented 8 years ago

This should be fixed now, try updating to 0.8.3.

shanmarkus commented 8 years ago

thank you @jonpacker

tobiadalsecco commented 8 years ago

It worked, thanks @jonpacker !