1

This issue is resolved in neo4j v4.1 update. But my question is related to neomodel v4.0.1. How do we resolve this issue in neomodel v4.0.1.

My queries: I have models.py as

from neomodel import StructuredNode, StringProperty, UniqueIdProperty()

class Person(StructuredNode):
  person_id = UniqueIdProperty()
  person_name = StringProperty()

when i execute

python manage.py install_labels it works fine with no errors

$ python manage.py install_labels
Setting up indexes and constraints...

Found django_neomodel.DjangoNode
 ! Skipping class django_neomodel.DjangoNode is abstract
Found neo4japp.models.Person
 + Creating unique constraint for person_id on label Person for class neo4japp.models.Person

Finished 2 classes.

But when I create its object like

modiji = Person(person_id='1', person_name='modiji').save()

it gives me this error

CypherSyntaxError: The old parameter syntax `{param}` is no longer supported. Please use `$param` instead (line 1, column 18 (offset: 17)) "CREATE (n:Person {create_params}) RETURN n"

As in OGM we can't manipulate cypher queries - how do I make it work? Please help.

I want to make use of OGM and don't want to hard code cypher queries to make my code effectively using django framework & neomodel.

If not then what is the alternative to neomodel to use OGM queries like the one in ORM so as to ease the database querying stuff?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
patilkrunal
  • 384
  • 1
  • 4
  • 14
  • 2
    the answers which i get mostly is `Parameters should be prefixed with $ in 4.0 instead of curly brackets. Just write $parametername instead of {parametername}` But how do i do this in neomodel using OGM features? – patilkrunal Dec 11 '20 at 05:34
  • Are you saying neomodel 4.0.0 or 4.0.1 solves the issue? If so, what prevents you from upgrading to one of these versions? – fbiville Dec 11 '20 at 18:01
  • 1
    sorry my bad. I am using neomodel v4.0.1(updated the question) & still the same issue. Is anybody able to add objects using models in neomodel?. I am trying to populate graph in neo4j using django but its showing CypherSyntaxError as mentioned above. Actually neo4j has few answers to replace {} with $ but how to do the same in neomodel? – patilkrunal Dec 11 '20 at 18:44

0 Answers0