Skip to content

Commit

Permalink
Merge pull request #790 from Murat-U-Saglam/patch-1
Browse files Browse the repository at this point in the history
Updated docs so connection is clearer
  • Loading branch information
mariusconjeaud committed Apr 23, 2024
2 parents 796d0cb + 9a6444a commit 8dcfa1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Connecting
Before executing any neomodel code, set the connection url::

from neomodel import config
config.DATABASE_URL = 'bolt://neo4j:neo4j@localhost:7687' # default
config.DATABASE_URL = 'bolt://neo4j_username:neo4j_password@localhost:7687' # default

This must be called early on in your app, if you are using Django the `settings.py` file is ideal.

Expand All @@ -34,7 +34,7 @@ Below is a definition of three related nodes `Person`, `City` and `Country`: ::
from neomodel import (config, StructuredNode, StringProperty, IntegerProperty,
UniqueIdProperty, RelationshipTo)

config.DATABASE_URL = 'bolt://neo4j:password@localhost:7687'
config.DATABASE_URL = 'bolt://neo4j_username:neo4j_password@localhost:7687'

class Country(StructuredNode):
code = StringProperty(unique_index=True, required=True)
Expand Down Expand Up @@ -77,7 +77,7 @@ Database Inspection - Requires APOC
===================================
You can inspect an existing Neo4j database to generate a neomodel definition file using the ``inspect`` command::

$ neomodel_inspect_database -db bolt://neo4j:neo4j@localhost:7687 --write-to yourapp/models.py
$ neomodel_inspect_database -db bolt://neo4j_username:neo4j_password@localhost:7687 --write-to yourapp/models.py

This will generate a file called ``models.py`` in the ``yourapp`` directory. This file can be used as a starting point,
and will contain the necessary module imports, as well as class definition for nodes and, if relevant, relationships.
Expand Down Expand Up @@ -115,7 +115,7 @@ Applying constraints and indexes
After creating a model in Python, any constraints or indexes must be applied to Neo4j and ``neomodel`` provides a
script (:ref:`neomodel_install_labels`) to automate this: ::

$ neomodel_install_labels yourapp.py someapp.models --db bolt://neo4j:neo4j@localhost:7687
$ neomodel_install_labels yourapp.py someapp.models --db bolt://neo4j_username:neo4j_password@localhost:7687

It is important to execute this after altering the schema and observe the number of classes it reports.

Expand All @@ -127,7 +127,7 @@ Remove existing constraints and indexes
Similarly, ``neomodel`` provides a script (:ref:`neomodel_remove_labels`) to automate the removal of all existing constraints and indexes from
the database, when this is required: ::

$ neomodel_remove_labels --db bolt://neo4j:neo4j@localhost:7687
$ neomodel_remove_labels --db bolt://neo4j_username:neo4j_password@localhost:7687

After executing, it will print all indexes and constraints it has removed.

Expand Down

0 comments on commit 8dcfa1d

Please sign in to comment.